Sutton74
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Having a page only show posts from a specific categoryForum: Fixing WordPress
In reply to: Having a page only show posts from a specific categorySeems to work, thanks.
However, it messes up the formatting pretty bad…Any idea on how to make the format unchanged while removing and posts not under the category ‘Blog’?
Old Way – https://i.imgur.com/G4LOn.png
New Way – https://i.imgur.com/AkYhd.png
Forum: Fixing WordPress
In reply to: Having a page only show posts from a specific categoryAm I able to embed html into that, as it does have a while script.
<?php if (have_posts()){ /* Display navigation to next/previous posts when applicable */ if (theme_get_option('theme_top_single_navigation')) { theme_page_navigation( array( 'next_link' => theme_get_previous_post_link('« %link'), 'prev_link' => theme_get_next_post_link('%link »') ) ); } while (have_posts()) { the_post(); get_template_part('content', 'single'); comments_template(); } /* Display navigation to next/previous posts when applicable */ if (theme_get_option('theme_bottom_single_navigation')) { theme_page_navigation( array( 'next_link' => theme_get_previous_post_link('« %link'), 'prev_link' => theme_get_next_post_link('%link »') ) ); } } else { theme_404_content(); } ?>
Forum: Fixing WordPress
In reply to: Having a page only show posts from a specific categoryHere is the code in functions.php —
if (!function_exists('theme_page_navigation')){ function theme_page_navigation($args = '') { $args = wp_parse_args($args, array('wrap' => true, 'prev_link' => false, 'next_link' => false)); $prev_link = $args['prev_link']; $next_link = $args['next_link']; $wrap = $args['wrap']; if (!$prev_link && !$next_link) { if (function_exists('wp_page_numbers')) { // https://www.ads-software.com/extend/plugins/wp-page-numbers/ ob_start(); wp_page_numbers(); theme_post_wrapper(array('content' => ob_get_clean())); return; } if (function_exists('wp_pagenavi')) { // https://www.ads-software.com/extend/plugins/wp-pagenavi/ ob_start(); wp_pagenavi(); theme_post_wrapper(array('content' => ob_get_clean())); return; } //posts $prev_link = get_previous_posts_link(__('Newer posts <span class="meta-nav">→</span>', THEME_NS)); $next_link = get_next_posts_link(__('<span class="meta-nav">←</span> Older posts', THEME_NS)); } $content = ''; if ($prev_link || $next_link) { $content = <<<EOL <div class="navigation"> <div class="alignleft">{$next_link}</div> <div class="alignright">{$prev_link}</div> </div>
And idea on what to change to make it category based? I’d appreciate any help you can give me.
Forum: Fixing WordPress
In reply to: Having a page only show posts from a specific categoryMy navigation is set up as an array, so I’m unable to just add a True statement for the category choice.
if (have_posts()){ /* Display navigation to next/previous posts when applicable */ if (theme_get_option('theme_top_single_navigation')) { theme_page_navigation( array( 'next_link' => theme_get_previous_post_link('« %link'), 'prev_link' => theme_get_next_post_link('%link »') ) );
Forum: Fixing WordPress
In reply to: Having a page only show posts from a specific categoryThere is plenty of reason if you understood the functionality of my website. And while, I could narrow it down to two different themes, its unlikely I could have it all embraced under one theme.
And I’d be unable to create them as pages due to the functionality of the site. I’d prefer to just have it so that my blog only pulls entries under the category ‘Blog’. I know its possible, as I have that functionality within https://zsuttonphoto.com/Blog/. I’m hoping someone here would be able to provide me with that single line of code that would make that its standard function.
Forum: Fixing WordPress
In reply to: Having a page only show posts from a specific categoryAnd the general idea is to have the previous and next links on the top and bottom of individual posts, but making sure its only pulling entries from the category ‘Blog’
Forum: Fixing WordPress
In reply to: Having a page only show posts from a specific categoryI assure you my website is running on three different themes. I designed them, afterall.
But by setting them to private, aren’t I making it so no one can view them but me? The ultimate goal is to make proof galleries, that clients will be able to direct link to and select photos they’d like to have edited.
Forum: Fixing WordPress
In reply to: Having a page only show posts from a specific categoryIts worth noting that my individual entries are on a separate theme, so we can just hard wire it into the code without any issues elsewhere