Community Forums › Forums › Archived Forums › Design Tips and Tricks › Genesis Entry Content Not Working
Tagged: genesis function
- This topic has 4 replies, 2 voices, and was last updated 7 years, 5 months ago by studiouser11.
-
AuthorPosts
-
October 30, 2016 at 12:57 pm #195519studiouser11Member
Hi,
I am new on genesis. i am designing my custom single.php template. Everything is ok but genesis entry content not working.
i am working on localhost. Can someone help me about this subject ?
single.php code ;remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); add_action( 'genesis_entry_header', 'genesis_post_info', 3 ); add_filter( 'genesis_post_info', 'sp_post_info_filter' ); function sp_post_info_filter($post_info) { $post_info = '[post_date] / [post_categories] '; return $post_info; } get_header(); do_action( 'genesis_before_content_sidebar_wrap' ); genesis_markup( array( 'open' => '<div %s>', 'context' => 'content-sidebar-wrap', ) ); do_action( 'genesis_before_content' ); genesis_markup( array( 'open' => '<main %s>', 'context' => 'content', ) ); do_action( 'genesis_before_loop' ); do_action( 'genesis_before_entry' ); printf( '<article %s>', genesis_attr( 'entry' ) ); genesis_markup( array( 'open' => '<div %s>', 'context' => 'entry-header-wrap', ) ); // Display featured image above content echo '<div class="entry-header-bg" style="background-image: url() ">'; genesis_image( array( 'size' => 'entry-header-bg' ) ); echo '</div>'; do_action( 'genesis_entry_header' ); genesis_markup( array( 'close' => '</div>', 'context' => 'entry-header-wrap', ) ); do_action( 'genesis_before_entry_content' ); printf( '<div %s>', genesis_attr( 'entry-content' ) ); do_action( 'genesis_entry_content' ); echo '</div>'; do_action( 'genesis_after_entry_content' ); genesis_widget_area( 'blog-signup', array( 'before' => '<div id="blog-signup" class="clearfix">', 'after' => '</div>', ) ); echo '</article>'; do_action( 'genesis_after_entry' ); do_action( 'genesis_after_loop' ); genesis_markup( array( 'close' => '</main>', // End .content. 'context' => 'content', ) ); do_action( 'genesis_after_content' ); genesis_markup( array( 'close' => '</div>', 'context' => 'content-sidebar-wrap', ) ); do_action( 'genesis_after_content_sidebar_wrap' ); get_footer();
October 30, 2016 at 4:59 pm #195527Brad DaltonParticipantSeem to be missing the genesis(); function which loads the header, footer, markup and other hooks.
No need for those tags and do_action hooks in your code
October 30, 2016 at 11:57 pm #195533studiouser11MemberHi braddalton,
Thanks for your reply. i am creating custom template. ı re designed index.php.
Now i am re designing single.php, for this reason i have to use this custom loop.Only problem here ;
printf( '<div %s>', genesis_attr( 'entry-content' ) ); do_action( 'genesis_entry_content' ); echo '</div>';
But entry content does not come.
How can i get the entry content ?
Thanks.
October 31, 2016 at 2:13 pm #195565Brad DaltonParticipantYou have to use the genesis(); function. Here's a basic single.php file for Genesis.
November 3, 2016 at 5:24 am #195660studiouser11MemberHi braddalton,
I changed the code. Now current code here ;
<?php /** // This file handles single entries, but only exists for the sake of child theme forward compatibility. remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); add_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 12 ); remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); add_action( 'genesis_entry_header', 'genesis_post_info', 3 ); remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); add_action( 'genesis_entry_header', 'jan_featured_img', 1 ); function jan_featured_img() { if ( has_post_thumbnail() ) { // checks post has thumbnail // gets URL for that image $background = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'featured-image' ); if (is_array($background)) { // echo the output echo '<div class="entry-header-wrap"><div class="entry-header-bg" style="background: url(' ; echo $background[0]; echo ') ">'; echo '</div></div>'; }} else { // if no featured image, adds class to use default image echo '<div class="entry-header-wrap"><div class="entry-header-bg">'; genesis_widget_area( 'ontop', array( 'before' => '<div class="features-widgetarea">', 'after' => '</div>', ) ); echo '</div></div>'; }} add_filter( 'genesis_post_info', 'sp_post_info_filter' ); function sp_post_info_filter($post_info) { $post_info = '[post_date] / [post_categories] '; return $post_info; } genesis();
And this is current screenshot ;
i want to to move entyr-meta and entry-header to entry-header-wrap div, and this display;
I searched the internet every website, but i cant find to how can i do this.
Who can help me with this little issue ?
Thanks.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.