• Resolved cneu

    (@cneu)


    So, if you goto https://chadneu.com and see the gallery it defaults to the AMP version. If you click the post it displays the proper gallery. Example: https://chadneu.com/gyro-seitan/

    If I go into my theme files and edit
    get_template_part( 'template-parts/content', get_post_type() );

    to be
    get_template_part( 'template-parts/content', 'single' );
    (or page) it works fine on the home page


    Judging by other support tickets it appears javascript is likely not loading on my front end/home page. I have no idea why this may be.

    • This topic was modified 9 months, 3 weeks ago by cneu.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Nadiya – SG Support

    (@wpdexterity)

    On your homepage, the gallery block is not rendering — specifically, the do_blocks() function isn’t being triggered.

    This usually means that the block content (in Gutenberg format) is being returned as raw HTML or block markup without being properly parsed into rendered HTML.

    Possible causes:
    1. Manual query is used in the template without applying filters like the_content.
    2. The template outputs post_content directly, instead of using:


    echo apply_filters( 'the_content', $post->post_content );

    3. The post content is being loaded via a custom WP_Query and displayed in a custom loop without proper formatting.
    4. You may be using get_the_content() instead of the_content() without applying filters manually.

    Thread Starter cneu

    (@cneu)

    Here’s the homepage code that’s relevant:

        <div class="theme-archive-layout <?php echo esc_attr( $archive_classes ); ?>">
    
            <?php
            /* Start the Loop */
            while ( have_posts() ) :
                the_post();
    
                    get_template_part( 'template-parts/content', get_post_type() );
    
                endwhile;
            ?>
        </div>
    
            <?php if ( is_front_page() && is_home() ) { ?>
                </div>
            <?php } ?>
        <?php
    
            do_action( 'terminal_blog_pro_posts_pagination' );
    
        else :
    
            get_template_part( 'template-parts/content', 'none' );
    
        endif;
        ?>

    and then compared to my page template:

    <main id="primary" class="site-main">
    
        <?php
        while ( have_posts() ) :
            the_post();
    
            get_template_part( 'template-parts/content', 'page' );
    
            if ( comments_open() || get_comments_number() ) :
                comments_template();
            endif;
    
        endwhile;
        ?>

    and my single template

    <?php
    while ( have_posts() ) :
        the_post();
    
        get_template_part( 'template-parts/content', 'single' );
    
        if ( $single_post_pagination === true ) {
    
            the_post_navigation(
                array(
                    'prev_text' => '<span class="nav-subtitle">' . esc_html__( 'Previous:', 'terminal-blog-pro' ) . '</span> <span class="nav-title">%title</span>',
                    'next_text' => '<span class="nav-subtitle">' . esc_html__( 'Next:', 'terminal-blog-pro' ) . '</span> <span class="nav-title">%title</span>',
                )
            );
    
        }
    
        if ( $single_post_comment_box === true ) {
    
            if ( comments_open() || get_comments_number() ) :
                comments_template();
        endif;
    
        }
    
        endwhile; 
    ?>

    So i’m not really sure where the difference is. It seems to be related to ‘get_post_type()’ because if I specify the post type the gallery loads just fine.

    Thread Starter cneu

    (@cneu)

    I may have found it.

    			<?php if ( $post_description === true ) : ?>
    <div class="post-content">
    <?php echo wp_kses_post( get_the_content( ) ); ?>
    </div><!-- post-content -->
    <?php endif; ?>

    Is how /templates/content.php is calling up post content, so that may be the issue.

    Edit: yup, editing that to ‘the_content’ instead of ‘get_the_content’ seems to have fixed it. Thanks.

    • This reply was modified 9 months, 3 weeks ago by cneu.
    Plugin Support Nadiya – SG Support

    (@wpdexterity)

    Great!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Home page galleries not loading(javascript?)’ is closed to new replies.