• Hi,

    Is it possible to put three different pictures on the featured icons front page but link them all to the same page?

    Thanks in advance..

Viewing 2 replies - 1 through 2 (of 2 total)
  • It can be done with javascript. d4z not available today but will ask him to give you a solution.

    If you add this to your child-theme functions php:

    add_filter('fp_img_src', 'my_custom_fp_imgs', 10, 2);
    function my_custom_fp_imgs( $original_image, $fp_single_id){
        $custom_img = array(
            //fp_id (one, two,three) => image_src
            'two' => 'wp-content/uploads/2014/05/49677d1c84277_big.jpg',
            'three' => 'wp-content/uploads/2014/05/49677d1c84257_big.jpg',
        );
        if ( array_key_exists($fp_single_id, $custom_img) )
            return sprintf('<img class="attachment-tc-thumb" width="270" height="250" alt="fp-image-%1$s" src="%2$s">',
                        $fp_single_id,
                        $custom_img[$fp_single_id]
                   );
        return $original_image;
    }

    And replacing those img_src with your image (270×250 size) urls you can do that.
    But I think you might want to change the titles too, so:

    add_filter('tc_fp_title' , 'my_custom_fp_titles', 10 , 2);
    function my_custom_fp_titles( $original_title , $fp_single_id) {
    
        //assigns a custom title by fp_id
        $custom_title = array(
            //fp id => 'Custom title'
            'two' => 'My custom title1',
            'three' => 'My custom title2'
        );
    
        if ( array_key_exists($fp_single_id, $custom_title) )
            return $custom_title[$fp_single_id];
    
        //if no custom title is defined for the current page id, return original
        return $original_title;
    }

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Featured Pages Icons’ is closed to new replies.