Category Display (HELP!!)
-
Alright, this is quite the task that I need to accomplish, so please let me know if you can help me on this.
I have a dog website, https://www.thecaninedirectory.com, which is just a directory of all dog breeds (incomplete so far).
Within the site, I want to categorize the dog breeds by AKC (American Kennel Club) breeds. So I have pages like https://www.thecaninedirectory.com/akc-group/hound-group, and similar to the other 6 categories.
As I’ve created posts, I’ve been categorizing the dog into one of the 7 groups.
Now what I want to do, is have on this page, https://www.thecaninedirectory.com/akc-group/hound-group, a list of all posts under the category “Hound”.
On the homepage, I like the way that the recent posts are organized, and I would like to have the categories displayed in the same way on https://www.thecaninedirectory.com/akc-group/hound-group.
I know that the homepage is using some sort of “limit posts” plugin to organize the content like that, I just don’t know how to get it to display all posts under a certain category under the “hound group” page.
This is the code for the limitpost plugin:
<?php /* Plugin Name: Limit Posts Plugin URI: https://labitacora.net/comunBlog/limit-post.phps Description: Limits the displayed text length on the index page entries and generates a link to a page to read the full content if its bigger than the selected maximum length. Usage: the_content_limit($max_charaters, $more_link) Version: 1.1 Author: Alfonso Sánchez-Paus Díaz y Julián Simón de Castro Author URI: https://labitacora.net/ License: GPL Download URL: https://labitacora.net/comunBlog/limit-post.phps Make: In file index.php replace the_content() with the_content_limit(1000, "more") */ function the_content_limit($max_char, $more_link_text = 'Read→', $stripteaser = 0, $more_file = '') { $content = get_the_content($more_link_text, $stripteaser, $more_file); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); $content = strip_tags($content,''); if (strlen($_GET['p']) > 0) { echo "<p>"; echo $content; echo " <a href='"; the_permalink(); echo "'>"."Read More →</a>"; echo "</p>"; } else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) { $content = substr($content, 0, $espacio); $content = $content; echo "<p>"; echo $content; echo "..."; echo " <a href='"; the_permalink(); echo "'>".$more_link_text."</a>"; echo "</p>"; } else { echo "<p>"; echo $content; echo " <a href='"; the_permalink(); echo "'>"."Read More →</a>"; echo "</p>"; } } ?>
This is the code for the Archives page
<?php get_header(); ?> <?php get_sidebar(); ?> <div id="content"> <?php if (have_posts()) : ?> <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?> <?php /* If this is a category archive */ if (is_category()) { ?> <h2 class="pagetitle">‘<?php echo single_cat_title(); ?>’ Category</h2> <?php /* If this is a daily archive */ } elseif (is_day()) { ?> <h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2> <?php /* If this is a monthly archive */ } elseif (is_month()) { ?> <h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2> <?php /* If this is a yearly archive */ } elseif (is_year()) { ?> <h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2> <?php /* If this is an author archive */ } elseif (is_author()) { ?> <h2 class="pagetitle">Author Archive</h2> <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> <h2 class="pagetitle">Blog Archives</h2> <?php } ?> <?php while (have_posts()) : the_post(); ?> <div class="single" id="post-<?php the_ID(); ?>"> <div class="title"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2> </div> <div class="date"><span class="author">Posted by <?php the_author(); ?></span> <span class="clock"> On <?php the_time('F - j - Y'); ?></span><span class="comm"><?php comments_popup_link('ADD COMMENTS', '1 COMMENT', '% COMMENTS'); ?></span> </div> <div class="cover"> <div class="entry"> <?php if(function_exists('the_content_limit')) { ?> <?php the_content_limit(350); ?> <?php } else { ?> <p> Activate the limitpost plugin to see the post contents ! </p> <?php } ?> <div class="clear"></div> </div> </div> <div class="singleinfo"> <div class="category">categories: <?php the_category(', '); ?> </div> </div> </div> <?php endwhile; ?> <div id="navigation"> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> </div> <?php else : ?> <h1 class="title">Not Found</h1> <p>Sorry, but you are looking for something that isn't here.</p> <?php endif; ?> </div> <?php get_footer(); ?>
Hopefully i gave enough information to solve this problem, and I will be most grateful for anyone that can help me with this.
Please let me know of anything I can do in return for whoever solves this.
thanks!
-Luke
- The topic ‘Category Display (HELP!!)’ is closed to new replies.