badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Remove Duplicate Posts in Editor’s Pick Section and Trending Stories Section

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #76764

    Hi,

    In my homepage, under “Editor’s Pick” and under “trending stories” section, there are the same 2 latest post.
    I want to remove the duplication, so that the ëditor’s pick” section will include the latest post that doesn’t appear in the “trending stories” section.

    What’s the code for that?

    #76966

    Hi there,

    Just go to the header.php file on line no:340 and paste the below line of code.

    if ( $newscard_settings['newscard_banner_featured_posts_1_hide'] === 0 ) {
        $featured_post_1_ids = wp_list_pluck( $newscard_get_featured_post_1->posts, 'ID' );
        $post_type_fp_2['post__not_in'] = array_unique( array_merge( $post_type_fp_2['post__not_in'], $featured_post_1_ids ) );
    }

    Note: Make sure to create child theme for any code customization so that your code won’t be lost while updating the theme to next version.

    #78467

    For some reason I didn’t get your answer to my email and meanwhile changed theme…
    I got back to these theme now and your solution works!
    However, I wanted to know how how can I get a homepage with 0 repetitive posts (except “Main stories” which I don’t mind repetitive there from other sections).

    Meaning, I want to display posts as follow:
    1. 2 latest posts under “trending stories”
    2. 2 posts before them – under “editor’s pick”
    3. 4 posts before them under “popular stories”
    4. below – earlier posts (that aren’t appear in any of the sections above)

    So what is the proper code for that?

    Thanks again!

    #78477

    We apologize, we might have missed your email. Thanks for getting back to our Theme again 🙂

    Sorry as per your requirement you need to hire a developer to customize the Theme code for you,
    currently you can only make this possible by showing the post through category where you can create different categories and assign the desired posts to desired category. This will help you to show different posts on different sections.

    Thanks

    #78528

    thanks again for your reply 🙂
    Can you please explain further the categories sections?

    After you’ve posted the first code chunk above – it worked well; “editor’s pick” and “trending stories” doesn’t contain same posts (for example, one contains posts 1+2, the other contains post 3+4).
    However, the section “popular stories” below them contains the 4 posts they already contain, even though I have over 8 different categories in my site.
    How can I avoid “popular stories” to repeat the posts under “editor’s pick” and “trending stories” sections?

    #78532

    *To be clear – I’m asking only about the “popular stories” section, because I understand what’s below is more complicated

    #78552

    Yes we do understand your requirement but this is also complicated as it needs more coding with more conditions check. Its better you manager to show through assigned category.

    Thanks

    #78633

    So I’ve created 8 different categories with one post per category, but still the last 4 posts that appear under “editor’s pick” and “trending stories” sections, repeat themselves under the “popular stories” section.
    What did I missed?
    Should I define which categories appear under each section? If so, how do I do it?

    #78640

    if you want to show on popular stories section then you can create a new category like ‘popular’ and then you can only assign that ‘popular’ category to those post which you want to show on that section then from the customizer you can set to show through category selecting ‘popular’.

    Thanks

    #78667

    Got it.
    Thanks a lot!

    #78685

    Welcome @mostinterestingpeopleinworld,

    Please let us know if you have any other queries regarding the Theme.

    Thanks

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.