kwbrayton
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Hemingway] Next and Previous within the same category@lokiofsassgaard, Not sure if this will resolve your problem but after reading the code reference for get_previous_post and get_next_post, I noticed a parameter $in_same_term which by default is set to false. I tried changing that to true in content.php and it seems to be working for my test.
https://developer.www.ads-software.com/reference/functions/get_previous_post/
Seems too easy but it’s working.
$prev_post = get_previous_post(true);
$next_post = get_next_post(true);Change the code around line 113-ish in config.php I’ll be curious to know your results.
Forum: Themes and Templates
In reply to: [Hemingway] Next and Previous within the same category@lokiofsassgaard, In light of a good night’s rest, I think I’ve uncovered the cause for the behavior you describe but I don’t have a cure. I’ve learned that if I assign more than one category to a post, it screws up the routine as you described. For this way to work, each post can have only one category assigned to it. I’m not smart enough nor motivated enough to figure out how to overcome that. Good luck sorting this out further.
Forum: Themes and Templates
In reply to: [Hemingway] Next and Previous within the same categoryThe default navigation for the Hemingway theme is to show the Next/Previous button if there is a next or previous post. When it gets to the end of the list, the Next/Previous will disappear as a clue that there are no more posts in that set. This code limits the set to just a category. The sample code from StackExchange has a couple of tweaks you have to do to get it to work smoothly with Hemingway. I set up a test site to try things out and it seemed to work as expected for me. The sample config.php file I included shows the tweaks I did to the original code. I’d love to let you see it in action on my test site but I’m having issues with my site at the moment. My web host is “working on it”. You can try and see if it will work for you. If you get a database error, keep refreshing and it usually will work.
Pick a category, then big a test blog, then navigate back and forth. Category test1 has 5 test blogs (1-5) and Category test2 has 4 test blogs (6-10).
As my WordPress skills are also limited, this is about the best I can offer. Hope you can sort it all out.
Oh yea, there is also a certificate issue with this site. You can safely ignore the warning to continue. One of the things I hope to resolve once my host resolves my hosting issue.
- This reply was modified 3 years, 6 months ago by kwbrayton.
Forum: Themes and Templates
In reply to: [Hemingway] Next and Previous within the same category@lokiofsassgaard, I found this discussion on StackExchange that got me pointed in the right direction for this idea:
You will find the navigation code in the content.php file of the theme. Copy the file into your child theme folder and modify it there. Here is my modified version. Look for “Begin Custom Code by Ken Brayton” where the mods are.
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="post-header"> <?php $post_format = get_post_format(); // On archive, only output the featured image and title on posts without a post format. if ( ( is_singular() || ! $post_format ) ) : hemingway_the_featured_media( $post ); if ( get_the_title() ) : $title_elem = is_singular() ? 'h1' : 'h2'; ?> <<?php echo $title_elem; ?> class="post-title entry-title"> <?php if ( ! is_singular() ) : ?> <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> <?php else : ?> <?php the_title(); ?> <?php endif; ?> </<?php echo $title_elem; ?>> <?php endif; endif; do_action( 'hemingway_before_post_meta', $post->ID ); $post_type = get_post_type(); $post_type_outputs_post_meta = hemingway_post_type_has_post_meta_output( $post_type ); if ( $post_type_outputs_post_meta ) : ?> <div class="post-meta"> <span class="post-date"><a href="<?php the_permalink(); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a></span> <span class="date-sep"> / </span> <span class="post-author"><?php the_author_posts_link(); ?></span> <?php if ( comments_open() ) : ?> <span class="date-sep"> / </span> <?php comments_popup_link( '<span class="comment">' . __( '0 Comments', 'hemingway' ) . '</span>', __( '1 Comment', 'hemingway' ), __( '% Comments', 'hemingway' ) ); ?> <?php endif; ?> <?php if ( current_user_can( 'manage_options' ) ) : ?> <span class="date-sep"> / </span> <?php edit_post_link( __( 'Edit', 'hemingway' ) ); ?> <?php endif; ?> </div><!-- .post-meta --> <?php endif; do_action( 'hemingway_after_post_meta', $post->ID ); ?> </div><!-- .post-header --> <div class="post-content entry-content"> <?php if ( is_search() ) { the_excerpt(); } else { the_content(); } wp_link_pages( array( 'before' => '<nav class="post-nav-links"><span class="label">' . __( 'Pages:', 'hemingway' ) . '</span>', 'after' => '</nav>', ) ); edit_post_link( __( 'Edit', 'hemingway' ), '<p>', '</p>' ); ?> </div><!-- .post-content --> <?php if ( is_singular() && $post_type_outputs_post_meta ) : ?> <div class="post-meta-bottom"> <?php if ( get_the_category() ) : ?> <p class="post-categories"><span class="category-icon"><span class="front-flap"></span></span> <?php the_category( ', ' ); ?></p> <?php endif; ?> <?php if ( has_tag() ) : ?> <p class="post-tags"><?php the_tags( '', '' ); ?></p> <?php endif; ?> <?php // ***** Begin Custom Code by Ken Brayton 8/20/2021 // ***** Credit for this idea goes to Nico Gawenda on the WordPress Development Forum // ***** https://wordpress.stackexchange.com/questions/149826/display-posts-from-the-same-category-using-next-previous-post-link?rq=1 $post_id = $post->ID; // Current post ID $cat = get_the_category(); // Get the category from the post $current_cat_id = $cat[0]->cat_ID; // Current category ID $args = array( 'category' => $current_cat_id, 'orderby' => 'post_date', 'order' => 'DESC' ); $posts = get_posts( $args ); // get IDs of posts retrieved from get_posts $ids = array(); foreach ( $posts as $thepost ) { $ids[] = $thepost->ID; } // get and echo previous and next post in the same category $thisindex = array_search( $post_id, $ids ); $next_post = isset( $ids[ $thisindex - 1 ] ) ? $ids[ $thisindex - 1 ] : false; $prev_post = isset( $ids[ $thisindex + 1 ] ) ? $ids[ $thisindex + 1 ] : false; ?> <?php // $prev_post = get_previous_post(); // $next_post = get_next_post(); // ***** End Custom Code by Ken Brayton 8/20/2021 if ( $prev_post || $next_post ) : ?> <nav class="post-nav group"> <?php if ( $prev_post ) : ?> <a class="post-nav-older" href="<?php the_permalink( $prev_post ); ?>"> <h5><?php _e( 'Previous post', 'hemingway' ); ?></h5> <?php echo get_the_title( $prev_post ); ?> </a> <?php endif; ?> <?php if ( $next_post ) : ?> <a class="post-nav-newer" href="<?php the_permalink( $next_post ); ?>"> <h5><?php _e( 'Next post', 'hemingway' ); ?></h5> <?php echo get_the_title( $next_post ); ?> </a> <?php endif; ?> </nav><!-- .post-nav --> <?php endif; ?> </div><!-- .post-meta-bottom --> <?php endif; if ( is_singular() ) { comments_template( '', true ); } ?> </article><!-- .post -->
- This reply was modified 3 years, 6 months ago by kwbrayton.
Forum: Themes and Templates
In reply to: [Hemingway] Hemingway SidebarHave you made any progress here? I’m not sure I’m following your question though. If I understand correctly, you are trying to add widgets to the Sidebar that shows up on the right? Are you saying you can’t drag and drop any of the Available Widgets to the Theme Sidebar? The three Theme Footer sidebars display in 3 columns at the bottom of the page. The “Sidebar” sidebar displays to the right of the page. You can create custom sidebars for different pages and then when you edit the page you want the sidebar visible on, you replace the “Sidebar” sidebar with your customer one. I’m not sure I’m really helping you here.
Forum: Themes and Templates
In reply to: [Hemingway] Change footer background colorThe code in the style.css that controls this is below. Unfortunately for you, the bg-dark element also controls the main menu background across the top. I couldn’t figure out how to modify the footer section without impacting the main menu. I suspect it would take a great deal of reworking the CSS and PHP to accomplish what you desire.
.section.bg-dark {
background: #be4749;
}.footer .widget-content {
color: #ffffff;
}.credits {
color: #ffffff;
}`Forum: Themes and Templates
In reply to: [Hemingway] Moving sidebar from right to left@shoemakersgarden, I found a note by Anders (the theme’s author) hinting at what needs to be done to move the sidebar to the left:
https://www.ads-software.com/support/topic/sidebar-on-the-left/
Since it looked like you were using a Hemingway child theme, I would suggest you copy the relevant files to your child theme folder and make the changes there. Otherwise, any new updates to Hemingway will overwrite changes to the primary theme files.
I just did a quick test after modifying these three files per Anders instructions and got it to work:
singular.php
404.php
sidebar.phpHope that helps!
Forum: Themes and Templates
In reply to: [Hemingway] Moving sidebar from right to leftCan I just check with you to be sure we’re talking the same thing? I don’t see a Sidebar on your sample page – yet. When you say Sidebar, I’m thinking of the stuff on the right-hand side of the page like on the site I support:
https://oakvillechurch.org/who-we-are/
The navigation menu is across the top, the sidebar goes down the right side. You wish to move the right-hand sidebar to the left-hand side, yes? The “Who We Are” links on my site.
Forum: Themes and Templates
In reply to: [Hemingway] Moving sidebar from right to leftNot trying to be difficult @shoemakersgarden, but I’m not seeing a sidebar on that page. Also, when I run your URL through WPThemeDetector (https://www.wpthemedetector.com/), I don’t see any reference to the Hemmingway theme. It says you’re using Teluro and a child of Teluro. You are also using 2 different page builders (Colibri and Elementor) which confuses things. This is the support area for the Hemingway theme. You might get better help elsewhere.
As I was looking at your About page, I noticed a couple of editing fixes:
In the section about Rosemoor, ” the 1970s,.was” (remove extra period before was)
In the same section about Rosemoor, “my aunt gifted if to the Royal” (if should be it)Best of luck to you.
UPDATE: So, I just noticed that your About page looks a lot like the Hemingway theme. Sure enough, when I ran that page through WPThemeDetector, it says that the page IS using the Hemingway Theme. Are you trying to get the 3 menu items (CONTACT|ABOUT|BLOG) shifted to the left on your Home page like they are on the About page? If so, using Google’s developer tools, it looks like that menu navigation section (not a sidebar) might be under the influence of the Colibri page builder. Kind of a guess on my part. I have no experience with Colibri or any other page builder tools. Nor do I know how to manage a website using different themes for different pages. So in the end, I can’t offer you much help! Sorry.
I believe there was an update released on May 5, 2021, for this theme. The bulk of the downloads occurred around that date so I’m guessing that it’s folks like me updating their theme.
Forum: Themes and Templates
In reply to: [Hemingway] is theme updated to use wp5.8?Huzzah! Congrats @llilly0 for figuring it out and for sharing your findings here. I wasn’t aware that Gutenberg has issues with Firefox. Bon voyage to you too!
Forum: Themes and Templates
In reply to: [Hemingway] is theme updated to use wp5.8?You’re welcome. I’m just a fellow traveler in this complex world of WordPress. Lessons learned from the school of hard knocks. Hope you can figure it out.
Forum: Themes and Templates
In reply to: [Hemingway] is theme updated to use wp5.8?Hmmm, odd behavior indeed. This makes me wonder if this might be browser-related. I assume you have a) Flushed Cache on your WordPress site, and b) Cleared browsing data on the web browser you are using?
Have you tried to access your WP site with another browser?
Also, as a test, you might try changing to another theme, check the results, then change back to Hemingway. I’ve been told that the theme Twenty Thirteen is a good fallback theme to use. Can’t remember why though – sorry.
I’m using Aksimet and Jetpack but none of the other plugins you’ve mentioned. You could try Deactivating them one by one and check if that makes any difference.
- This reply was modified 3 years, 7 months ago by kwbrayton. Reason: SPelling error
Forum: Themes and Templates
In reply to: [Hemingway] is theme updated to use wp5.8?Your welcome, @llilly0. Just curious, but could you elaborate a bit on what you mean by blank spaces? Is the entire page blank or are you just seeing missing content here and there? Is it text, images, or something else? Just trying to see if I can help you diagnose the problem. My money is on some plugin that isn’t compatible with WP5.8. I did receive one warning about a sidebar widget incompatibility with WP5.8. For more insight, check this article:
https://www.wpbeginner.com/news/whats-new-in-wordpress-5-8-features-and-screenshots/
I did install the Classic Widgets plugin on my site as suggested by this article. I haven’t taken the time to thoroughly debug this issue as everything is working normally right now.
Forum: Themes and Templates
In reply to: [Hemingway] is theme updated to use wp5.8?FWIW, my host updated WordPress to 5.8 this week. I’ve been all through my live site (mostly made up of pages) and haven’t come across any issues. My pages and blocks (I’m using the Gutenberg Block Editor) are all behaving normally.