Filter To Modify Genesis Archive Page Sitemap Template

This code enables you to add, remove or edit the default output generated by the page_archive.php file included in Genesis.

This file which is native to Genesis can be used via any Genesis child theme simply by selecting the Archive option from the drop down menu in the Page Attributes box on any Page Edit screen.

sitemap-template

The archive outputs a sitemap which includes headings and a list of pages, archives and recent posts.

The filter includes the following functions you can remove, add to or modify:

wp_list_pages( 'title_li=&echo=0' ) );
wp_list_categories( 'sort_column=name&title_li=&echo=0' ) );
wp_list_authors( 'exclude_admin=0&optioncount=1&echo=0' ) );
wp_get_archives( 'type=monthly&echo=0' ) );
wp_get_archives( 'type=postbypost&limit=100&echo=0' ) );

Here’s the code you simply add to the end of your child themes functions file and modify to your liking :

Related Code Snippets


Comments

10 responses to “Filter To Modify Genesis Archive Page Sitemap Template”

  1. jmelee1221 Avatar
    jmelee1221

    Is it possible to filter the authors by who wrote the most amount of posts first – numerical order from the highest amount to the lowest amount?

    1. jmelee1221 Avatar
      jmelee1221

      I created a custom page_archive.php and used this code if it matters to give me the page to show – Monthly // Authors // Recent 100 posts. I just need to be able to have the Author section not by alphabetical order but my numerical order of who wrote the most amount of posts

      CODE USED:

      <?php
      }

      genesis();

      PAGE LINK of currrent page: http://weheartthis.com/archives/

      1. jmelee1221 Avatar
        jmelee1221

        Sorry it didnt post the code. This is what I used for the page_archive.php

        <?php
        }

        genesis();

        1. Brad Dalton Avatar
          Brad Dalton

          Send me the file please. brad@wpsites.net

          1. jmelee1221 Avatar
            jmelee1221

            It made the authors disappear completely.

            LINK>> http://weheartthis.com/archives/

          2. jmelee1221 Avatar
            jmelee1221

            Never mind I got it. The last 0 in the code needs to be a 1 and it works. THANKSSSSSS a million Brad!

  2. Would it be possible to get a yearly archive instead of a monthly?

    That is instead of january 2017, february 2017 and so on have it by year:
    2017 jan feb march april….
    2016 jan feb march april….

    1. Brad Dalton Avatar
      Brad Dalton

      Change monthly to yearly in the code like this.

      1. jmelee1221 Avatar
        jmelee1221

        Is there a way possible to get the code above in raw? I am not 100% if there is a ; in it or not. Sorry :/

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.