WordPress.org

Ready to get started?Download WordPress

Forums

Collapse-O-Matic
[resolved] It shouldn't display in single post page (6 posts)

  1. talha8877
    Member
    Posted 1 year ago #

    I use Collapse-o-matic for limiting the content displayed in my post lists.
    It works very well there since I want to give a brief info, but it also shows up in the post-page and hides the most part of the post content.

    Is there a way to avoid this and have it not hide the content in 'is_page()'?

    http://wordpress.org/extend/plugins/jquery-collapse-o-matic/

  2. Baden
    Member
    Plugin Author

    Posted 1 year ago #

    yes. Collapse-O-Matic needs to be used not in the content, but in the theme. If you want more help, you will need to provide more detail, including a link.

  3. talha8877
    Member
    Posted 1 year ago #

    I'm sorry I didn't understand what you meant by not using in the content. We use shortcodes to implement the plugin therefore it's used in the content, isn't it?
    Please see here
    If you click on title you'll see the full post is collapsed as well.

  4. Baden
    Member
    Plugin Author

    Posted 1 year ago #

    I will try to explain:
    1. if you include the collapse element as part of your content then wherever that content is displayed, the shortcode magic comes with it. Regardless of which page the content is being displayed: is_home() or is_single() or is_page() will always display the content WITH the short code.

    however...

    2. if you included the collapse element as part of your template then you can control where the content will be collapsed, and where it will just be pure, uncollapsed content goodness.

    On your site, you would want to make the intro text (the part that is never collapsed) the post's excerpt. The content that is collapsed (on your homepage) but not collapsed when the user visits the actual article--could then be controlled within the templates used for your index.php and single.php template files (or whatever they are called in your theme).

    If this is going over your head, you might want to contact your theme developer, or someone that can help you with customizing your theme.

    Hope that helped more than confused you.

    To sum up:

    The loop on the home page template would use do_shortcode and might look something like

    the_title();
    the_excerpt();
    do_shortcode('[expand title="read more" swaptitle="read less"]'.get_the_content().'[/expand]');

    and the loop on the single article template more like:

    the_title();
    the_excerpt();
    the_content();

  5. talha8877
    Member
    Posted 1 year ago #

    Thanks for the explanation. I will apply this.

  6. Baden
    Member
    Plugin Author

    Posted 1 year ago #

    You are very welcome, let us know if you get it working!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic