• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • 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

Custom Post Type Archive Page can't title of page or read more link

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 › Archived Forums › General Discussion › Custom Post Type Archive Page can't title of page or read more link

This topic is: not resolved

Tagged: archive page template, custom loop, Custom Post Type

  • This topic has 1 reply, 1 voice, and was last updated 2 years, 9 months ago by asbilly92.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 6, 2020 at 2:47 pm #497766
    asbilly92
    Participant

    I have been working on this for a long time. It is served locally so I can't post a link. I'm trying to modify the default CPT archive page/make a custom one. I have made the template, and it is calling most of the wanted things. However, it will not pull in the title of the page no matter what I do. I even added support for content archive intro settings; which is also showing in the dashboard; not on the front end tho.

    I don't even want anything special, just to be able to state the page name and some intro text before the loop starts. I was also unable to call the 'read-more' link after the do_action( 'genesis_entry_footer') (that part is removed at the moment)

    Any help appreciated! Thank you!

    What am I doing wrong... here is my code for the CPT archive page:

    <?php
    /**
     * Template Name: Sales Horses Archives
     * Description: Used as a page template to show page contents, followed by a loop through a CPT archive 
     */
    
    //* Remove the action that automatically outputs the headline and intro-text
    remove_action( 'genesis_before_loop', 'genesis_do_cpt_archive_title_description' );
    
    //* Custom output
    add_action( 'genesis_before_loop', 'rv_cpt_archive_title_description' );
    function rv_cpt_archive_title_description() {
    
    	/**
    	 *	Genesis stores the archive settings in an option (array) named genesis-cpt-archive-settings-{post_type}
    	 *	This example uses a custom post type called 'sale horses'
    	 */
    	$archive_settings = get_option( 'genesis-cpt-archive-settings-service' );
    
    	echo $archive_settings['headline'];
    
    	echo $archive_settings['intro_text'];
    }
    
    /** Replace the home loop with our custom loop**/
    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'holland_custom_loop' );
    
    /** Custom  loop **/
    function holland_custom_loop() {
    if ( have_posts() ) :
    
    		do_action( 'genesis_before_while' );
    		while ( have_posts() ) : the_post();
    
    			do_action( 'genesis_before_entry' );
    
    			printf( '<article %s>', genesis_attr( 'entry' ) );
    
    				do_action( 'genesis_entry_header' );
    
    				do_action( 'genesis_before_entry_content' );
    
    				printf( '<div %s>', genesis_attr( 'entry-content' ) );
    				
    				//do_action( 'genesis_entry_content' ); //Remove standard excerpt
    				
    				echo genesis_do_post_image(); //Add in featured image
    				
    				
    			
    				
    				echo '</div>';
    
    				do_action( 'genesis_after_entry_content' );
    
    				do_action( 'genesis_entry_footer' );
    				
    				
    
    			echo '</article>';
    
    			do_action( 'genesis_after_entry' );
    
    		endwhile; //* end of one post
    		do_action( 'genesis_after_endwhile' );
    
    	else : //* if no posts exist
    		do_action( 'genesis_loop_else' );
    	endif; //* end loop
    
    }
    
    genesis();
    http://n/a
    April 7, 2020 at 5:21 am #497792
    asbilly92
    Participant

    Sorry, my title should read: Custom Post Type Archive Page not pulling title of page or read more link. Too tired when I posted that!

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 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