Prev/Next Navigation on Single Post Disappeared for Custom Post Type

Question

Hope it’s okay to ask this question here – I’m not really a developer. I’ve been using Dox theme for a friend’s website, and we are ready to go live over the weekend and the Theme developer isn’t getting back very fast.

I’ve done some CSS customisations on the website, not a huge amount of changes on templates. We moved the website to the server we’d like to go live on, and had a few issues re PHP Version (the server was on ver 5.6 and it had the old website on, but some elements of the new site require ver 7.0+), changing the version seemed to have solved most of the problems, but this is something we both have only noticed today (may have happened before today) – the Prev/Post buttons on custom post types have disappeared – so that’s the Projects and Events on the site, it continues to be working and fine for Posts.

Pages – Project: https://fitkin.com/2020/project/veneer-2002-2003/
Post: https://fitkin.com/2020/unanswered-questions-about-bike-design/

I’ve tried disabling plugins, take out all custom CSS etc., didn’t seem to have made any difference. And the navigation is enabled in the theme setting (in Customizer) Any advice much appreciated

The Navigation template:

    <div class="fy-post-nav">

        <div class="fy-flex-container fy-flex-container-stretch fy-flex-gutter-large">
            <div class="fy-flex-column-auto fy-flex-column-tablet-100">

                <?php
                if ( $prev ) {
                    $args  = array(
                        'post_type'      => get_post_type(),
                        'posts_per_page' => 1,
                        'p'              => $prev->ID
                    );
                    $query = get_posts( $args );

                    foreach ( $query as $post ) {
                        setup_postdata( $post );

                        // Thumbnail
                        $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id(), FORQY_THEME_SLUG . '-medium-fixed' );
                        // Thumbnail Image
                        $thumbnail_image = $thumbnail[0];
                        ?>

                        <a href="<?php the_permalink(); ?>" class="fy-post-nav-post fy-post-prev">
                            <div class="fy-post-nav-header">
                                <?php esc_html_e( 'Previous', 'dox' ); ?>
                                <h3><span><?php the_title(); ?></span></h3>
                            </div>
                        </a>

                        <?php
                        wp_reset_postdata();
                    }
                }
                ?>

            </div>
            <div class="fy-flex-column-auto fy-flex-column-tablet-100">

                <?php
                if ( $next ) {
                    $args  = array(
                        'post_type'      => get_post_type(),
                        'posts_per_page' => 1,
                        'p'              => $next->ID
                    );
                    $query = get_posts( $args );

                    foreach ( $query as $post ) {
                        setup_postdata( $post );

                        // Thumbnail
                        $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id(), FORQY_THEME_SLUG . '-medium-fixed' );
                        // Thumbnail Image
                        $thumbnail_image = $thumbnail[0];
                        ?>

                        <a href="<?php the_permalink(); ?>" class="fy-post-nav-post fy-post-next">

                            <div class="fy-post-nav-header">
                                <?php esc_html_e( 'Next', 'dox' ); ?>
                                <h3><span><?php the_title(); ?></span></h3>
                            </div>
                        </a>

                        <?php
                        wp_reset_postdata();
                    }
                }
                ?>

            </div>

        </div>

    </div>

<?php }

}

0
, , , uchijjang 1 year 2020-07-14T16:10:27-05:00 0 Answers 63 views 0

Leave an answer

Browse
Browse