Community Forums › Forums › Archived Forums › Design Tips and Tricks › Changes to Archive Template
Tagged: archives
- This topic has 6 replies, 3 voices, and was last updated 9 years, 3 months ago by justin1990.
-
AuthorPosts
-
December 18, 2014 at 7:28 pm #134864justin1990Member
Does anyone know how to remove the "Pages" and "Categories" from an Archive page?
I would like to just keep the posts and the dates of these posts. Thanks in advance!
December 20, 2014 at 10:02 am #134956Brad DaltonParticipantWhat happens if you copy the file over to your child theme and remove the code for the pages and categories?
Try removing this code from the file after you copy it over:
<h4><?php _e( 'Pages:', 'genesis' ); ?></h4>
-
<?php wp_list_pages( 'title_li=' ); ?>
-
<?php wp_list_categories( 'sort_column=name&title_li=' ); ?>
December 24, 2014 at 3:14 am #135238justin1990MemberWhich file am I copying over to the child theme (I have metric) and how do I do this?
December 24, 2014 at 3:21 am #135239justin1990MemberI should say...which part of the "archive" template should I copy and which parts should I omit? And where do I paste it? At the end of the metric child theme, like just on the bottom?
I don't want to mess anything up by pasting it in the wrong spot or pasting the wrong code.
December 24, 2014 at 9:24 am #135261DTHkellyMemberI don't know which childtheme you are using, but from the Genesis Framework folder, you can copy the content of page_archive.php.
<?php /** * Genesis Framework. * * WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances. * Please do all modifications in the form of a child theme. * * @package Genesis\Templates * @author StudioPress * @license GPL-2.0+ * @link http://my.studiopress.com/themes/genesis/ */ //* Template Name: Archive //* Remove standard post content output remove_action( 'genesis_post_content', 'genesis_do_post_content' ); remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); add_action( 'genesis_entry_content', 'genesis_page_archive_content' ); add_action( 'genesis_post_content', 'genesis_page_archive_content' ); /** * This function outputs sitemap-esque columns displaying all pages, * categories, authors, monthly archives, and recent posts. * * @since 1.6 */ function genesis_page_archive_content() { ?> <h4><?php _e( 'Pages:', 'genesis' ); ?></h4> <ul> <?php wp_list_pages( 'title_li=' ); ?> </ul> <h4><?php _e( 'Categories:', 'genesis' ); ?></h4> <ul> <?php wp_list_categories( 'sort_column=name&title_li=' ); ?> </ul> <h4><?php _e( 'Authors:', 'genesis' ); ?></h4> <ul> <?php wp_list_authors( 'exclude_admin=0&optioncount=1' ); ?> </ul> <h4><?php _e( 'Monthly:', 'genesis' ); ?></h4> <ul> <?php wp_get_archives( 'type=monthly' ); ?> </ul> <h4><?php _e( 'Recent Posts:', 'genesis' ); ?></h4> <ul> <?php wp_get_archives( 'type=postbypost&limit=100' ); ?> </ul> <?php } genesis();
Offline, using Notepad++ (or equivalent), delete the code Brad suggested. Save offline as page_archive.php
Using FTP, upload page_archive.php to your ChildTheme (not to the Genesis framework folder.
Now, you ChildTheme will control what the archive displays,
December 24, 2014 at 9:34 am #135262Brad DaltonParticipant<?php //* Template Name: Archive //* Remove standard post content output remove_action( 'genesis_post_content', 'genesis_do_post_content' ); remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); add_action( 'genesis_entry_content', 'genesis_page_archive_content' ); add_action( 'genesis_post_content', 'genesis_page_archive_content' ); function genesis_page_archive_content() { ?> <h4><?php _e( 'Authors:', 'genesis' ); ?></h4>
-
<?php wp_list_authors( 'exclude_admin=0&optioncount=1' ); ?>
-
<?php wp_get_archives( 'type=monthly' ); ?>
-
<?php wp_get_archives( 'type=postbypost&limit=100' ); ?>
December 29, 2014 at 8:57 pm #135618justin1990MemberWhat part of the childtheme do I upload it to Kelly? The end of it (the css one)? It doesn't seem to be working...
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.