Genesis, Single.php and EO

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 9 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15798

    I am using a Genesis sub-theme (News Pro) and am trying to customize the appearance of a single event page. I read this thread, but its recommendation seems not to apply to Genesis. The single.php in Genesis has just this one line of code:

    genesis();
    

    So, it is not possible to rearrange the individual content items and sidebar.

    My specific objective is to get the event image and description above the meta data for the event.

    Howard Jacobson
    #15811

    Hi Howard,

    The Genesis framework handles templates very differently. If you create a copy of single.php, named single-event.php then you should find that the page renders, but without the event details.

    You can then use the hooks Genesis provides to insert content where you want it to appear.

    I’m afraid I’m not familiar with Genesis’ hooks but you’ll want a hook that fires after the post content on the single post page. They should have support/documentation to help you get the right one.

    Then:

    add_action( '...genesis hook here...', 'my_post_content_event_details' );
    function my_post_content_event_details(){
          if( is_singular( 'event' ) && 'event' == get_post_type( get_the_ID() ) ){
                  eo_get_template_part('event-meta','event-single');
          }
    }
    
    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.