WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] How to remove 'Related Posts' on Category Pages? (16 posts)

  1. Chirag
    Member
    Posted 1 year ago #

    I need 'Related Posts' only on Posts and not on other category pages.
    I'm using ELI's Related Posts Plugin and I can't find any option to remove 'Related Posts' from Category Pages.

  2. Marventus
    Member
    Posted 1 year ago #

    Hi. If there is no option to remove them, you might be able to hide them using CSS. However, I would need a link to your site to tell you exactly what code you need.

  3. Chirag
    Member
    Posted 1 year ago #

    Well I am yet to finish with my blog so it isn't live for now.

  4. Chirag
    Member
    Posted 1 year ago #

    For now I have hosted it for free.
    Check it out
    http://higheredublog.onlinewebshop.net/

  5. Marventus
    Member
    Posted 1 year ago #

    The best way to do this would be to call the plugin through a content filter in your functions.php (using conditional tags) or a shortcode function in your single.php file.
    Filter:

    function eli_related_posts($content) {
        if ( is_single() ) {
            $related = related-posts-call();
            $content .= $related;
        }
        return $content;
    }
    add_filter('the_content', 'eli_related_posts');

    Single.php:

    echo do_shortcode('[eli_related_posts_shortcode]');

    However, I don't see any indications about that in the plugin info, but you could ask the author.
    If none of the solutions above are possible, there's always the css way:

    .category .SPOSTARBUST-Related-Posts,
    .archive .SPOSTARBUST-Related-Posts {
        display:none;
    }
  6. Chirag
    Member
    Posted 1 year ago #

    Hey Thank you "Related Posts" is no longer on category pages :)
    But now it is giving me an error on posts page

    Fatal error: Call to undefined function call() in /srv/disk1/1183879/www/higheredublog.onlinewebshop.net/wp-content/themes/the-bootstrap/functions.php on line 129

  7. Chirag
    Member
    Posted 1 year ago #

    Well first of all I tried using CSS but it isn't working.

  8. Marventus
    Member
    Posted 1 year ago #

    If you want Related Posts to appear in pages as well, you would have to expand your conditional checks to this:

    if ( is_single() || is_page() ) {
        // do smth
    }

    As for the CSS, it works fine on this JSFiddle I made. I put your entire GRE category page source in the HTML panel and the CSS rule I recommended in the CSS panel and it worked.
    you could also try this to force it not to display:

    .category .SPOSTARBUST-Related-Posts,
    .archive .SPOSTARBUST-Related-Posts {
        display:none!important;
    }
  9. Chirag
    Member
    Posted 1 year ago #

    "important" worked
    Thanks alot :)

  10. Marventus
    Member
    Posted 1 year ago #

    Glad it did. I just realized I forgot to paste the link to the actual JSFiddle, haahha. Oh well...
    Take care,

    Marv

    Edit: Oh, BTW, you have a top margin applied to your submenus which sometimes makes the submenu disappear before you can click on any sub-items. My suggestion would be to look for the dropdown-menu selector on l.763 of the bootstrap.min.css file, and change the margin property from:

    margin:2px 0 0;

    to:

    margin:0;
  11. Chirag
    Member
    Posted 1 year ago #

    Ah I didn't notice that.
    Thanks once again :)

    Best Regards,
    Chirag

  12. Chirag
    Member
    Posted 1 year ago #

    BTW Marv any other suggestions to improve the blog?

  13. Marventus
    Member
    Posted 1 year ago #

    No problem.
    Nothing seems to come to mind right now since everything looks quite right.
    Perhaps something you might consider is expanding WP search capabilities, especially if you are going to have lots of information on your site. A plugin such as Relevanssi would definitely come in handy. It's a little hard to figure out at first, but once you get a hang of it, it's really useful.
    If anything else comes to mind I'll let you know.

  14. Chirag
    Member
    Posted 1 year ago #

    Thanks alot :)

  15. newscookies
    Member
    Posted 1 year ago #

    Marventus i am unable to contact you via the comfy theme thread so only i am posting it here. I need one urgent help from you. I saw you have given some solutions to afgans website issues. I had issues with uploading featured images in COMFY V 3.1 Theme but i resolved it yesterday some how. Now I am only left with this Video functionality issue. Even though I am working on this theme in my local system but my laptop is connected to internet so the youtube videos links has to work but i dont know why it is not working. I want to know what procedure you followed to load the video in the small framebox the way afgans website is showing. Please help me as i am not getting support from Deluxe Themes.

  16. @newscookies This theme is resolved already, please create your own topic instead.

    http://wordpress.org/support/forum/how-to-and-troubleshooting#postform

    Also? That's not a theme that is supported here please contact them for support.

Topic Closed

This topic has been closed to new replies.

About this Topic