WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Class for post/page

[Resolved] Class for post/page

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Ajay
    Participant

    @ajay

    Danny,

    it isn’t there right now. Would your theme have a separate class for the content area for post or page?

    If so, you could probably use that. So something like:

    .class_page .crp_related
    and
    .class_post .crp_related

    Ajay,

    It is combined in 1 widget area. So occasionally the pages and posts are mixed in together.

    Plugin Author Ajay
    Participant

    @ajay

    I understand now. You mean each list item?

    Yes that’s correct. That way I could just use CSS to hide the date on any list item with a class of page.

    Plugin Author Ajay
    Participant

    @ajay

    It hasn’t been implemented yet, but I can put this on the list of things to do.

    Any ideas for a quick solution on this?

    Thanks!

    Plugin Author Ajay
    Participant

    @ajay

    I don’t see any easy solution for this. You’ll need to edit contextual-related-posts.php

    You could try something like this for now:
    Line 104: change from:

    $output .= $crp_settings['before_list_item'];

    to

    $output .= str_replace("%posttype%",get_post_type( $result->ID ),$crp_settings['before_list_item']);

    Then in your Output Options tab for “HTML to display before each item”, you can change it to

    <li class="%posttype%">

    This should replace %posttype% with the actual post type i.e. post or page and you can apply your CSS styles then.

    Do let me know if this works for you.

    After making the edits I get the following now on my page:

    “No related posts found”

    Thank you for taking the time to help me out with this.

    Plugin Author Ajay
    Participant

    @ajay

    Danny, is this for all pages or just a specific one?

    What happens when you revert the changes?

    Happened with about 10 pages that I clicked through. I put back the original code and it displayed the related content again.

    Plugin Author Ajay
    Participant

    @ajay

    Danny,

    I’ll need to test the above code on my servers in detail to see what can work.

    I’m not exactly sure what’s going wrong, but most likely its messing up the algorithm.

    Ok, thank you for your help!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Resolved] Class for post/page’ is closed to new replies.