Community Forums › Forums › Archived Forums › General Discussion › Custom Blog Template
Tagged: blog templates
- This topic has 3 replies, 3 voices, and was last updated 8 years, 5 months ago by dimensionseo.
-
AuthorPosts
-
March 25, 2016 at 2:07 pm #182248brettatkinMember
Given the following (http://foralles.com/community/), I've created a grid layout for the blog "Home" page. I have a Page in WP called "Community" that uses this blog template.
I want to display the PAGE Title and Content but not the POST title and content from each post. Here is my code for a file called page_blog.php
<?php /** * Template Name: Blog * This is your custom Blog page */ //* Show page content above posts add_action( 'genesis_loop', 'genesis_standard_loop', 5 ); //* Add the featured image after post title add_action( 'genesis_entry_header', 'foralles_grid' ); function foralles_grid() { if ( has_post_thumbnail() ){ echo '<div class="archive-featured-image">'; echo '<a href="' . get_permalink() .'" title="' . the_title_attribute( 'echo=0' ) . '">'; echo get_the_post_thumbnail($thumbnail->ID); echo '</a>'; echo '<a href="' . get_permalink() .'" title="' . the_title_attribute( 'echo=0' ) . '">'; echo the_title( '<h2>', '</h2>' ); echo '</a>'; echo '</div>'; } } //* Remove the ad widget remove_action( 'genesis_before_loop', 'adspace_before_loop' ); //* Remove author box remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 ); //* Remove the post meta function remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); //* Remove the post info function remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); //* Force full width content layout add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); //* Remove the entry title (requires HTML5 theme support) remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); //* Remove the post content remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); genesis();
This block of code is doing nothing...I can remove it and the page looks the same.
//* Show page content above posts add_action( 'genesis_loop', 'genesis_standard_loop', 5 );
If I remove this block of code, the page AND post title/content gets displayed (which I don't want - I just want the page content).
http://foralles.com/community///* Remove the post content remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
March 26, 2016 at 7:17 am #182277Victor FontModeratorThe loop query retrieves posts, not pages. I am not understanding what you mean by you want to display the page title and content and not the post title and content. Posts are not pages, neither are they associated with pages. When displayed as a single post, the post title is the page title. Unless you modify the loop query, you can only display posts. You need to be more specific with content examples if you want help with this.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?March 26, 2016 at 11:28 am #182294brettatkinMemberVictor, I want to do what the default WooCommerce Shop page does. It the Dashboard, WC creates a page called "shop". What I enter on that page for the Title and Content shows up on the Shop page above the product output.
I hard-coded the Title and Content into the page_blog.php template file, but I want to make this dynamic - the client can update.
http://foralles.com/community/
Does that help?
Thanks
Brett
March 28, 2016 at 6:16 am #182358dimensionseoMemberHello Victor,
I was also facing same problem when i was trying to fix my website layout and after reading your post i got to know where am i doing wrong thing. Thanks!I love to be here.
Thanks
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.