• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WriteNowDesign - Wordpress and Ecommerce Website Design

WordPress, Joomla, Ecommerce Website Design

  • Home
  • Prices/Packages
  • WordPress
  • Services
  • Portfolio
  • Blog
  • About
    • Testimonials
    • Locations
    • Online Payment
  • Contact
  • Show Search
Hide Search

Call 303-907-6133 Email

How to Modify Genesis Search Results Page

How to Customize Genesis Site Map Page

September 24, 2013 by Pat Fortino

The default Genesis Archive does a great job of creating a sitemap, but what if you want to modify it? If you’re like me and have only one author on your blog, it seems a little silly to list the authors in the site map. The following tutorial explains how to modify the default Genesis Site Map page.

This tutorial requires that you duplicate and modify a Genesis php file, but it’s is pretty simple and does not require a plugin.

IMPORTANT: This tutorial is for Genesis 2.x. Also, I recommend that you make these changes on a test site in case your changes cause problems with your site. If you don’t have a test site and these changes cause errors on your live site, you can delete page_archive.php from your child theme.

The default Genesis site map includes the following lists:

  • Pages
  • Categories
  • Authors
  • Monthly
  • Recent Posts

You can modify or remove any of the default lists. In addition, you can add your own content to the page.

  1. Create a new Page and assign the Archive template. If you want to add introduction text above the sitemap, enter it on this page.
    Assign WordPress Page Template
  2. In your Genesis child theme folder, create a new page called page_archive.php; for example, /wp-content/themes/agency/page_archive.php
  3. Find the following file and select and copy all its content:
    /wp-content/themes/genesis/page_archive.php
  4. Open the page_archive.php file in your Genesis child them and paste the contents of the original Genesis page_archive.php. If you want, you can use the following code:
    <?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();
  5. Modify the code to add or remove content.
    Pages: Page 1 Page 2

Comments are closed. If you have information to share, contact me here.

Previous Post: « How to Build a Portfolio for Genesis 2.0
Next Post: bbPress v Simple:Press »

Reader Interactions

Comments

  1. Stephen says

    October 6, 2013 at 11:06 am

    This article was just what I needed. Excellent instructions. My site is all pages, so not only did you help me make the sitemap, but I was also able to remove the categories, etc.

    Suggestion: The only other thing this article could use is a snippet for excluding pages like “thanks for contacting us” pages, etc. Now I have to go find that code somewhere else.

    If I find it, I hope their instructions are as helpful as yours.

    • Pat Fortino says

      October 7, 2013 at 7:11 am

      If you want to exclude pages, see this: http://codex.wordpress.org/Function_Reference/wp_list_pages

      For example, where page id equals 10.

Related

Primary Sidebar

Blog Categories

Call Today

Get a Free Quote

303-907-6133

Subscribe to News

News about WordPress, WooCommerce, & Technology

What’s New

  • WPForms Not Sending Notifications
  • Add Terms and Conditions WooCommerce
  • Fix WordPress AMP Validation Errors
  • Use the Classic Editor with Gutenberg Block Editor
  • Add a Message at Top or Bottom of WooCommerce Checkout Page
  • How to Link to a PDF in WordPress

Find Us On…

  • Facebook
  • LinkedIn
  • RSS

Call 303-907-6133 Email

© 2004–2023 · WriteNowDesign · Sitemap · Log in · Return to Top

 

Loading Comments...