• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Discussion
  • Design Tips
  • Showcase/Feedback
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to include cpt entries in sitemap using genesis_sitemap_output filter?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › General Discussion › How to include cpt entries in sitemap using genesis_sitemap_output filter?

This topic is: not resolved

Tagged: get_posts, sitemap

This topic contains 3 replies, has 2 voices, and was last updated by  juso 4 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • October 10, 2016 at 10:04 am #194457

    juso
    Participant

    Want to include in sitemap cpt entries created using genesis-portfolio-pro plugin.

    I would include the code in functions.php just as I have other items

    /* Filter Genesis Sitemap with genesis_sitemap_output */

    add_filter( 'genesis_sitemap_output', 'denou_sitemap' );
    function denou_sitemap() {
    
    	$heading = ( genesis_a11y( 'headings' ) ? 'h2' : 'h4' );
     
        $sitemap  =  sprintf( '<%2$s>%1$s</%2$s>', __( 'Pages:', 'genesis' ), $heading );
        $sitemap .=  sprintf( '<ul>%s</ul>', wp_list_pages( 'title_li=&echo=0' ) );
     
        $sitemap .=  sprintf( '<%2$s>%1$s</%2$s>', __( 'Categories:', 'genesis' ) , $heading );
        $sitemap .=  sprintf( '<ul>%s</ul>', wp_list_categories( 'sort_column=name&title_li=&echo=0' ) );
    
        $sitemap .=  sprintf( '<%2$s>%1$s</%2$s>', __( 'Authors:', 'genesis' ) , $heading );
        $sitemap .=  sprintf( '<ul>%s</ul>', wp_list_authors( 'exclude_admin=0&optioncount=1&echo=0' ) );
    
        $sitemap .=  sprintf( '<%2$s>%1$s</%2$s>', __( 'Monthly:', 'genesis' ) , $heading );
        $sitemap .=  sprintf( '<ul>%s</ul>', wp_get_archives( 'type=monthly&echo=0' ) );
     
        $sitemap .=  sprintf( '<%2$s>%1$s</%2$s>', __( 'Recent Posts:', 'genesis' ) , $heading );
        $sitemap .=  sprintf( '<ul>%s</ul>', wp_get_archives( 'type=postbypost&limit=100&echo=0' ) );
    
        $sitemap .=  sprintf( '<%2$s>%1$s</%2$s>', __( 'Portfolio:', 'genesis' ) , $heading );
        $sitemap .=  sprintf( '<ul>%s</ul>', ( ---> here goes code i'm looking for <--- ));
    
        return $sitemap;
    }
    

    Any help??

    October 10, 2016 at 11:16 am #194465

    braddalton
    Participant

    You could use get_posts


    2600 Genesis Tutorials

    October 10, 2016 at 12:16 pm #194471

    braddalton
    Participant

    Actually, here's a better solution


    2600 Genesis Tutorials

    October 11, 2016 at 7:13 am #194499

    juso
    Participant

    thanks Brad, quick and good reply!!

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2021 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble