[Resolved] Excerpt Action Hook

Home Forums Support [Resolved] Excerpt Action Hook

Home Forums Support Excerpt Action Hook

Viewing 15 posts - 1 through 15 (of 39 total)
  • Author
  • #918051

    Is there any way of inserting an opening/closing shortcode tag before/after the excerpt shown on archive pages? – perhaps with some kind of hook?. Would also need to do the same for WP Show Posts lists.

    Customer Support

    Hi there,

    Not exactly sure what you are trying to do but I don’t believe so.

    The excerpt for GP and WP Show Posts is actually handled by WordPress’ core function.

    You can learn more about it here with lots of examples towards the bottom of the page:

    You can check it out in action here:

    Hope this helps πŸ™‚


    Basically I want to put the excerpt inside an accordion/expander.

    Customer Support

    Hi there,

    Instead of placing the excerpt inside a toggle we could do this:

    1. Create a new hook element
    1.1 Add this markup to create a toggle ‘button’:

    <span class="accordion-toggle">toggle</span>

    1.2 Select the after_entry_header hook
    1.3 Set you display rules to blog and archive

    2. Create a second hook for our our jQuery:

    <script type="text/javascript">
      jQuery(document).ready(function($) {
          //Expand or collapse this panel
          //Hide the other panels
          //Switch toggle

    2.1 Select the WP_footer hook
    2.2 Set the display rules the same as first hook.

    3. Add this CSS to hide the Excerpt when page is first loaded:

    .entry-summary {
    	display: none;

    You then just need to edit your original span for the toggle text / icon you want. When its open the toggle span will get the toggle-open class so you can style it differently.


    Thank you David this is working brilliantly on the Blog/Category Archive pages. Any way to get it working on WP Show Posts lists too?

    Customer Support

    Awesome πŸ™‚
    so create another hook like the first one. This time select the Custom Hook in the hook list and in the field provided add: wpsp_after_title and set your display rules to cover any of the pages where WPSP is being used.


    ok I have the toggle displaying but it’s above the wp-show-posts-entry-summary html so doesn’t contain the excerpt.

    Customer Support

    Here’s the main hooks you can add content to in WPSP:


    Maybe try the wpsp_before_content – if not i would need to see the site.


    Thanks David, I tried wpsp_before_content and it works but the toggle is open on page load, I’d want it closed.


    Silly me, all I had to do was add the WP Show Posts html to the display:none rule, .wp-show-posts-entry-summary.

    Thank you very much David it works really well.

    I’ve also learnt how to use the custom hooks feature which would seem to add even more power/customization options, as I believe it will allow you to use any hook from any plugin you have installed?.

    Customer Support

    Aah my bad, yes the CSS needed updating
    That’s really cool – i like these sorts of ideas. May borrow that for another Site πŸ™‚

    Yes Custom Hooks any hook that is available for adding content can be used.


    Just thought I’d mention it doesn’t work when using Infinite Scroll. I had a feeling that would be the case as I was already using another hook below the title for another plugin and that doesn’t work with infinite scroll either. The plugin developer said it’s on his to-do list but isn’t an easy fix, so for the time being perhaps I will disable Infinite Scroll and just use normal pagination.

    Customer Support

    Hmmm… i’ll take a look, thanks for reporting.


    Just wondering if you had any time to look into this yet?

    Customer Support

    I think the issue is the jQuery isn’t being triggered in thee WP_Footer due to the infinite scroll. Nots sure though. Can you try moving it to the WP_head.

Viewing 15 posts - 1 through 15 (of 39 total)
  • You must be logged in to reply to this topic.