• Resolved PaulaPurple

    (@paulapurple)


    Is there a way to change the size of the pictures that appear under the “Related” articles at the bottom of blog posts? Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    You can use the jetpack_relatedposts_filter_thumbnail_size filter to change the size of the thumbnails used by Related Posts.
    https://developer.jetpack.com/hooks/jetpack_relatedposts_filter_thumbnail_size/

    You’ll need to place that snippet in a functionality plugin like this one.

    I hope this helps.

    Thread Starter PaulaPurple

    (@paulapurple)

    Many thanks for your help.

    Thread Starter PaulaPurple

    (@paulapurple)

    It seems to have worked, thanks! Now, I’d like to change it so that Related Posts do not appear on my Job listings pages. Is that possible?

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    I’d like to change it so that Related Posts do not appear on my Job listings pages. Is that possible?

    That would depend on the name of the Custom Post Type used to display your job listings. You can find that out by accessing the Job listing menu in your dashboard, and copying the post type name from the URL.

    Once you have that information, you can add the following to a functionality plugin. You will need to replace job_listing by your post type name, if it’s called differently:

    function jetpackme_remove_rp() {
        if ( class_exists( 'Jetpack_RelatedPosts' ) && is_singular( 'job_listing' ); ) {
            $jprp = Jetpack_RelatedPosts::init();
            $callback = array( $jprp, 'filter_add_target_to_dom' );
            remove_filter( 'the_content', $callback, 40 );
        }
    }
    add_filter( 'wp', 'jetpackme_remove_rp', 20 );
    
    Thread Starter PaulaPurple

    (@paulapurple)

    Hi Jeremy,

    I keep getting this error message:

    The snippet has been deactivated due to an error on line 2:
    syntax error, unexpected ‘;’

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    I’m sorry, I made a typo!

    Try this instead:

    function jetpackme_remove_rp() {
        if ( class_exists( 'Jetpack_RelatedPosts' ) && is_singular( 'job_listing' ) ) {
            $jprp = Jetpack_RelatedPosts::init();
            $callback = array( $jprp, 'filter_add_target_to_dom' );
            remove_filter( 'the_content', $callback, 40 );
        }
    }
    add_filter( 'wp', 'jetpackme_remove_rp', 20 );
    Thread Starter PaulaPurple

    (@paulapurple)

    It worked perfectly. Many thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Related articles’ is closed to new replies.