[Resolved] Post excerpt not cohesive between blog posts

Home Forums Support Post excerpt not cohesive between blog posts

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1317020
    Bjørnar

    Hi,

    I have a site where I post music for download, and license. Using Generatepress and loving it! Great theme.

    I have made a child theme, and added the following code to functions.php get it to show shortcodes and HTML in the excerpt. The front page should only show a little card, or excerpt if you will…

    
    //Enable Shortcodes in WordPress Excerpts and Text Widgets. Add to functions.php
    add_filter( 'get_the_excerpt', 'my_shortcode_parser' );
    function my_shortcode_parser( $excerpt ) {
        return do_shortcode($excerpt);
    }

    So in the excerpt I want to have an audio player, button to the purchase page on sellfy, and a download MP3 button. This works on most of the blog posts. But on some, the link to sellfy is not visible. But if I inspect the code, I think its there. The audio player also looks different on some posts.

    Probably me doing something wrong… but any suggestion on what to check why certain elements doesnt show up?

    I have disabled caching, etc.

    #1317328
    Leo
    Staff
    Customer Support

    Hi there,

    I’m not sure unfortunately.

    So you are using the custom excerpt metabox and adding shortcode to all of them?

    #1317330
    Bjørnar

    Yes I use the custom excerpt box. I add both shortcodes, and HTML codes to sites like sellfy etc.

    #1317337
    Bjørnar

    Under the “Element 115” Excerpt I have added this code. In the excerpt box.

    <a href="https://sellfy.com/p/tq9pti/" id="tq9pti" class="sellfy-buy-button" data-text="Pro License From"></a>
    <script src="https://sellfy.com/js/api_buttons.js"></script>

    But it doesnt show the button (that code should generate) on the excerpt. But this code does work on the other excerpts before Element 115.

    #1317661
    Bjørnar

    Seems like disabling “Infinite Scroll” fixed the issue.

    #1317879
    David
    Staff
    Customer Support

    Hi there,

    looks like your script is only firing on an initial load – so it doesn’t load on elements that are Ajax Loaded like infinite scroll does.

    I am not sure how to fix that – aside from not using Load More / Infinite scroll options.

    #1317887
    Bjørnar

    The important part is that we found out why the issue was happining. Now onto google to search for some coding tips.

    Cheers. 🙂

    #1318189
    David
    Staff
    Customer Support
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.