WordPress.org

Support

Support » Plugins and Hacks » Collapse-O-Matic » [Resolved] It shouldn't display in single post page

[Resolved] It shouldn't display in single post page

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Baden

    @baden03

    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.

    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.

    Plugin Author Baden

    @baden03

    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();

    Thanks for the explanation. I will apply this.

    Plugin Author Baden

    @baden03

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] It shouldn't display in single post page’ is closed to new replies.
Skip to toolbar