gregtallent2
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: New version of press this gives 403 errorHave the same problem. Am on Hostgator. Any solution, anyone? Thanks.
Forum: Fixing WordPress
In reply to: Single post page: previous post link not workingGot the single page ‘newer’ and ‘older’ posts links working. Had to go back to the original single.php file without any of my modifications. 🙂
Thank you, again, alchymyth.
Forum: Fixing WordPress
In reply to: Single post page: previous post link not workingThank you very much for your suggestions, alchymyth.
But, that doesn’t work. Same link generated. I think I’m going to go to a newer theme.
Forum: Fixing WordPress
In reply to: Single post page: previous post link not workingThank you, alchymyth.
I get a
Call to a member function get() on a non-object in /home4/bearstor/public_html/wp-includes/query.php on line 28.. error with both suggestions, having taken out these lines:
$wp_query = null;
$wp_query = $original_query;The call just doesn’t like the new parameter.
Forum: Fixing WordPress
In reply to: Single post page: previous post link not workingLink to the recommended list, please.
Full code now:
<?php /** * The Template for displaying all single posts. * * @package Emphaino * @since Emphaino 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php // emphaino_content_nav( 'nav-above' ); ?> <?php get_template_part( 'content', 'single' ); ?> <?php endwhile; // end of the loop. ?> </div> <!-- #content .site-content --> </div> <div class="div_clear"></div> <div class="bottom_post"> <?php foreach((get_the_category()) as $category) { $cat=$category->cat_name . ' '; } ?> <h1 class="more_post">Recommended</h1> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php $post_id=get_the_ID(); $tags = wp_get_post_tags($post_id); $i = 0; foreach ( $tags as $tag ) { $tag_array[$i] = $tag->term_id; $i++; } $original_query = $wp_query; $wp_query = null; $args=array('posts_per_page'=>30, 'tag__in' => $tag_array, 'post__not_in' => array($post_id) ); $wp_query = new WP_Query( $args ); // query_posts(array( // // 'post_type' => 'post', // // 'tag_in' => $tag_array // // // ) ); ?> <?php if ( have_posts() ) : ?> <?php if( is_paged() ) emphaino_content_nav( 'nav-above' ); ?> <?php if ( 'dynamic_grid_excerpts' == get_theme_mod( 'posts_layout', emphaino_default_settings('posts_layout') ) ) echo '<div id="dynamic-grid" class="clearfix">'; ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /* Include the Post-Format-specific template for the content. * If you want to overload this in a child theme then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php if ( 'dynamic_grid_excerpts' == get_theme_mod( 'posts_layout', emphaino_default_settings('posts_layout') ) ) echo '</div> <!-- #dynamic-grid -->'; ?> <?php $wp_query = null; $wp_query = $original_query; emphaino_content_nav( 'nav-below' ); ?> <?php else : ?> <?php get_template_part( 'no-results', 'index' ); ?> <?php endif; ?> <?php get_footer(); ?> </div><!-- #content .site-content --> </div> </div> <!-- #primary .content-area -->Forum: Fixing WordPress
In reply to: Single post page: previous post link not working.. on every post!
Forum: Fixing WordPress
In reply to: Single post page: previous post link not workingThank you, alchymyth.
It now generates links to previous and next posts, but they’re the same ones… 🙂
Forum: Fixing WordPress
In reply to: Single post page: previous post link not workingBy the way, doing a search on say ‘video’ and the older posts link works fine.
Forum: Fixing WordPress
In reply to: Older posts links do not workPlease ignore this thread as it’s misleading.
Here’s the accurate one:
https://wordpress.org/support/topic/single-post-page-previous-post-link-not-working?replies=1Forum: Fixing WordPress
In reply to: Single post page: previous post link not workingThanks, alchymyth.
Haven’t changed the recommended section.
Link to single ‘previous post’ is broken as mentioned in top message.
Here’s the full code:
<?php /** * The Template for displaying all single posts. * * @package Emphaino * @since Emphaino 1.0 */ get_header(); ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php // emphaino_content_nav( 'nav-above' ); ?> <?php get_template_part( 'content', 'single' ); ?> <?php endwhile; // end of the loop. ?> </div> <!-- #content .site-content --> </div> <div class="div_clear"></div> <div class="bottom_post"> <?php foreach((get_the_category()) as $category) { $cat=$category->cat_name . ' '; } ?> <h1 class="more_post">Recommended</h1> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php $post_id=get_the_ID(); $tags = wp_get_post_tags($post_id); $i = 0; foreach ( $tags as $tag ) { $tag_array[$i] = $tag->term_id; $i++; } $original_query = $wp_query; $wp_query = null; $args=array('posts_per_page'=>30, 'tag__in' => $tag_array, 'post__not_in' => array($post_id) ); $wp_query = new WP_Query( $args ); // query_posts(array( // // 'post_type' => 'post', // // 'tag_in' => $tag_array // // // ) ); ?> <?php if ( have_posts() ) : ?> <?php if( is_paged() ) emphaino_content_nav( 'nav-above' ); ?> <?php if ( 'dynamic_grid_excerpts' == get_theme_mod( 'posts_layout', emphaino_default_settings('posts_layout') ) ) echo '<div id="dynamic-grid" class="clearfix">'; ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /* Include the Post-Format-specific template for the content. * If you want to overload this in a child theme then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php if ( 'dynamic_grid_excerpts' == get_theme_mod( 'posts_layout', emphaino_default_settings('posts_layout') ) ) echo '</div> <!-- #dynamic-grid -->'; ?> <?php emphaino_content_nav( 'nav-below' ); ?> <?php else : ?> <?php get_template_part( 'no-results', 'index' ); ?> <?php endif; ?> <?php get_footer(); ?> </div><!-- #content .site-content --> </div> </div> <!-- #primary .content-area -->Forum: Fixing WordPress
In reply to: Single post page: previous post link not workingThanks.
Forum: Fixing WordPress
In reply to: Single post page: previous post link not workingThanks, will take a look. Probably quicker than trying to fix the code in Emphaino.
Forum: Fixing WordPress
In reply to: Single post page: previous post link not workingThanks, wpjobz.
I’m using a custom home page. I’m using a simple single post page which should have a list of recommended posts and then then previous post link at the bottom.
Can you recommend a new theme that does a simple job?
Forum: Fixing WordPress
In reply to: Older posts links do not workUm… seems I can’t resolve it for a while…
Forum: Fixing WordPress
In reply to: Older posts links do not workSorry, should add, I’m on a single post page and I get a link to the same page as in:
.. when I should only get a link to the previous post.
Can’t delete this forum post so will resolve it and start another.