Taxonomy Featured Image

#11972
  • Resolved Sam
    free

    I don’t believe this is an existing feature of RankMath, but it would be great to have the ability to set an image custom field as the “featured image” for a taxonomy. I know we can set the Facebook or Twitter image directly, but I think a lot folks use a consistent image for a given category.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    For targeting category page OG images, I would suggest that you hook onto the following filter on your theme’s functions.php file:

    /**
     * Allows developers to change the OpenGraph image within theme.
     *
     * The dynamic part of the hook name. $network, is the network slug. Can be facebook or twitter.
     *
     * @param string $attachment_url The image we are about to add.
     */
    add_filter( "rank_math/opengraph/{$network}/image", function( $attachment_url ) {
    	return $attachment_url;
    });

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Taxonomy Featured Image’ is closed to new replies.