Post Excerpt Conflict
-
I tried visiting the official website for the plugin. The CAPTCHA on the “Register” page is broken, so I was unable to register and start a thread on the support forum. I was also unable to send an e-mail through the website.
I DID notice that the plugin has been updated within the last two months, so hopefully the creator is still active checking these support sections.
The Advanced Post Slider plugin is fantastic, but I noticed an issue when using the shortcode on a page in my theme.
I have the shortcode at the top of the document, like this:
<?php echo do_shortcode("[advps-slideshow optset='4']"); ?>
Lower in the document I have the typical WordPress loop, only instead of using <?php the_content(); ?> to retrieve my blog entries, I’m using:
<?php echo wp_trim_words( get_the_excerpt(), 80, " ... <a href=" . get_permalink() . ">Read More" . '</a>' ); ?>
If, for example, in the Advanced Post Slider settings, the excerpt length is set to 25 words, it sets the number of words on each entry in the loop to 25 words as well, instead of the 80 I have specified in my theme. It also removed my “Read More” link as well, and replaced it with three dots […].
When I post the shortcode AFTER the loop, everything appears as it should. It’s only when it’s before the loop that I run into problems.
From what I’ve gleaned from other online resources, it would seem this has something to do with needing a wp_reset_query or wp_reset_postdata somewhere, but I don’t know enough to determine where that might be in the plugin. I know when I use multiple loops elsewhere in other themes I have to use wp_reset_postdata so that they don’t interfere with each other.
Please let me know if I can provide any more information that will help solve the issue.
- The topic ‘Post Excerpt Conflict’ is closed to new replies.