To insert code use <code>...</code>.
Disable "Related & Popular Post Module" on specific pages - Customization
  • Hi, is there a way to disable the "Related & Popular Post Module" on specific pages/article/categories? Thanks for help!
  • 7 Comments sorted by
  • Hi,

    Please put in the link to the page you want them disabled so we can give you the correct code.

    Best regards,
    Striking Team
    Paul
  • Hi, I have some "productpages" where I want to disable the related/popular posts.

    expl.: http://designers-inn.de/web-site-cost-calculator-web-fee/
  • Hi

    You can only do this on post-id



    .postid-15770 .related_popular_wrap {
    display: none;
    }


    and you will have to repeat this for all posts you want this to happen.

    you can install a plugin from wordpress.org wp show ids to see the id's in the backend.


    Best regards,
    Striking Team
    Paul
  • Okay. Thanks.
    It would be a nice feature to get on/off-Button for that some day ;)
  • You can easily write this code yourselves and thus create a "on/off button". Just create a custom field in the page, set it to true or false and add corresponding code (if statements) to the single.php.

    You can read more on custom fields in this thread and it will give you a idea on howto.

    http://kaptinlin.com/support/discussion/4099/clicking-on-featured-image-in-blog-how-to-open-iframe-customization-how-to#Item_11

    you could easily replace the code in the single_php by

    replace line 44 by this

    <?php if(theme_get_option('blog','related_popular') && !(get_post_meta(get_the_ID(), 'striking-hide-extra-info', true))):?>


    now add a custom field to the post you dont want the info in called striking-hide-extra-info and set its value to false, true or any dummy content. If the custom field is not added to a post the popular/related info will show. So no need to add it and set it to false. The code does not work that way and only checks if the custom field exists.

    Image and video hosting by TinyPic

    However to add this ability for a complete category you will have to write custom coding checking for the existence of the category and add such code to the if statement above. But this can also be done easily. If you choose this version for the solution then you dont need custom fields and you can just add a category to a post which causes the info not to display in a single page and thus acting like a on/off switch.

    f.e.

    && !(in_category('Yourcatname')) then bla bla bla

    https://codex.wordpress.org/Function_Reference/in_category

    if you are not familiar with such coding you should hire someon todo so.

    Best regards,
    Striking Team
    Paul

  • wow, thanks for this good answer. I´ll try it :)
  • HI

    As you know, we only provided a global setting to toggle on and off the Related and Popular Post module in the Striking Blog Panel. To date, no one has ever asked us for the ability to toggle it on and off by post - likely as most sites if they want this option in the single post, want it for all single posts.

    we will consider adding it as a feature to the Blog Single Options section of the Blog edit post screen, so that one can override the global settings, if more users indicate an interest in this feature.

    So anyone else who likes this idea, please state so in this thread!

    Happy Striking
    Striking Team
    James