• Resolved harbie

    (@harbie)


    is there a way to hide posts from the “related posts” section. I think only that is missing.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author MartinCV

    (@martin7ba)

    Hello @harbie

    Which ‘related posts’ section are you referring to? Is it maybe the ‘Lastest Posts’ block in gutenberg?

    Thread Starter harbie

    (@harbie)

    Its the section below the blog that shows

    “Related Posts”

    and shows posts related to that category. Even though I turn off category and archive, still pops up in there.

    Code kind of looks like this:

    $related = get_posts( array( ‘category__in’ => wp_get_post_categories($post->ID), ‘numberposts’ => 4, ‘post__not_in’ => array($post->ID) ) );
    if( $related ) foreach( $related as $post )
    {
    setup_postdata($post);

    Plugin Author MartinCV

    (@martin7ba)

    Hey @harbie, this is showed on a single post page.

    The plugin currently doesn’t have an option to run the logic on Single post pages, but I will try to add in the next version.

    Best,
    Martin

    Plugin Author MartinCV

    (@martin7ba)

    @harbie I added new update that has option to hide posts on single post page. Please check it and let me know if it will work

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

The topic ‘Hide Posts – Related Posts’ is closed to new replies.