• 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

Remove Action for genesis_custom_loop entries but not page template

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 › Design Tips and Tricks › Remove Action for genesis_custom_loop entries but not page template

This topic is: not resolved

Tagged: blog page, page_blog.php

  • This topic has 8 replies, 4 voices, and was last updated 9 years, 1 month ago by Ignatlenivec.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • December 21, 2016 at 5:46 am #197936
    GSmith84
    Member

    I don't like replacing the genesis loop entirely unless I have to do heavy customization. I wanted to know if there was a way to target post entries with genesis hooks outside of the page template its on. An example being I re-position the entry title for the Page Template but don't want that to carry over to the loop returned posts and / or remove the entry content of the loop posts but not the actual page entry.

    eg: A Blog Listing Template

    (Have this only affect the Page Template Title)

    //* Re-position Header
    remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    add_action( 'genesis_before_content', 'genesis_do_post_title' );

    (Have this only affect the Post Entry Titles)

    //* Remove the post content (requires HTML5 theme support)
    remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
    December 21, 2016 at 8:00 am #197942
    Victor Font
    Moderator

    You need to use WordPress conditions like is_page(), is_single(), or is_singular(). Wrap your code in the appropriate one of these conditionals to target pages or posts.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    December 22, 2016 at 9:34 am #198006
    GSmith84
    Member

    I appreciate the response, unfortunately that really isn't what I'm going for. I was hoping to create a Blog Page that instead of show all the content of each post only shows the featured image and the title. I could always just display:none the content but I would need to re-position the default title / image genesis loop outputs. I'll just have to customize it completely, I was just curious if there was a way to target those separate of the page.

    December 23, 2016 at 9:05 pm #198063
    Brad Dalton
    Participant

    1. Copy over the archive-portfolio.php file from the Executive Pro child theme
    2. Rename it page_blog.php and add a page template header

    //* Template Name: Blog

    3. Remove the code in the file which forces a full width content layout and remove the code which adds the custom body class.

    This will display the title and featured image on the blog page.


    Tutorials for StudioPress Themes.

    December 28, 2016 at 5:50 pm #198394
    Ignatlenivec
    Member

    hi. i need to do the same thing - in a sample theme to relocate the header of each post inside the entry-contend and don't show content or excerpts, only the image, the title inside and (!) "Read more..." in my language. and i need to do this without changing files of root genesis, only for child theme and for this blog page only.

    but how? i understand that i can use smth like is_page(id) in main genesis loop but seriously? i'll not so gracefully how i want and for what i've bought so cool framework(

    December 29, 2016 at 12:47 am #198400
    Brad Dalton
    Participant

    You can remove the entry header using PHP code

    And add it back using another hook


    Tutorials for StudioPress Themes.

    December 29, 2016 at 7:51 am #198409
    Ignatlenivec
    Member

    thanks, brad. realy interesting second link, i start to understand how genesis is versatile and will try all of these things.

    but i don't see the way to place header inside entry-content BEFORE content itself. or can i place featured image outside of the entry-content and before content-header? i need smth like this:

    and i was so glad when read about conditional tags for hooks like

    if ( ! is_single() ) { 
    remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); 
    }

    but it's not work for me for unknown reason, it's just disable content totally, not only for blog page.

    December 29, 2016 at 8:09 am #198410
    Brad Dalton
    Participant

    I assume you want to reposition the entry header including the title and post meta to the entry content hook on single post only.

    add_action( 'loop_start', 'your_function' );
    function your_function() {
    
    if ( ! is_singular( 'post' ) )
    return;
    
    remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
    remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
    
    add_action( 'genesis_entry_content', 'genesis_entry_header_markup_open', 1 );
    add_action( 'genesis_entry_content', 'genesis_do_post_title', 2 );
    add_action( 'genesis_entry_content', 'genesis_post_info', 3 );
    add_action( 'genesis_entry_content', 'genesis_entry_header_markup_close', 4 );
    }
    

    Tutorials for StudioPress Themes.

    December 29, 2016 at 12:37 pm #198437
    Ignatlenivec
    Member

    thank you so much, i'll try it all today-tomorrow once again. now it's work but without conditionals. it's just execute the hooks but everywhere(

    and i want to ask two questions. first is about these hooks instead simple php code like <?php the_title() ?> in templates. how slow or fast this method in context of server calls etc? i mean is this way not to slower than ordinary wp template markup? i see it's very versatile (if conditional tags will work) but it must not to do my sites slower i think.

    and second: pay part of wpsites.net is not so cheap but can i pay for month and copy some articles in and for future? i know it's brazenly but... 🙂

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Design Tips and Tricks’ 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

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