Community Forums › Forums › Archived Forums › Design Tips and Tricks › custom blog template for home page
Tagged: blog post, blog template
- This topic has 8 replies, 2 voices, and was last updated 7 years ago by ramesh85.
-
AuthorPosts
-
October 8, 2017 at 10:50 pm #212299ramesh85Member
hi,
my site URL is https://www.bargainblessings.com.i would like to adding a toggle option to view the blog as a grid format or a traditional blog format (how it is now). I'd like the grid format to be the default format. example of a toggle button between views here: hip2save.com
any one can help me to do this part, because i created a custom blog template for home page for this part, but template will not display the blog posts.
thank you
https://www.bargainblessings.com.October 8, 2017 at 11:09 pm #212300Brad DaltonParticipantYou can add the read more link using the Genesis > Theme Settings > Content Archive > Display > Entry Content settings.
October 11, 2017 at 9:48 pm #212446ramesh85Memberhi ,
thank you for your quick reply, i have attached screenshots links here :
example site : http://hip2save.com/http://www.bargainblessings.com/wp-content/uploads/2017/10/layout.png
http://www.bargainblessings.com/wp-content/uploads/2017/10/grid-view.png
http://www.bargainblessings.com/wp-content/uploads/2017/10/list-view.pngi am looking for this layout to my genesis theme. let me know the code parts?
thank you
October 11, 2017 at 11:03 pm #212448ramesh85Memberhi can you please check my replies ?
October 11, 2017 at 11:09 pm #212449Brad DaltonParticipantYou have 2 options :
1. You can find a plugin which enables you to add this functionality to your child theme.
2. Look for a tutorial which provides the custom code to add this functionality manually to your theme.
October 11, 2017 at 11:22 pm #212452ramesh85MemberMy custom code :
http://www.bargainblessings.com/wp-content/uploads/2017/10/mycode.png
and i created a new page called 'New' and i assigned this blog template there
link : https://www.bargainblessings.com/new/
http://www.bargainblessings.com/wp-content/uploads/2017/10/1-3.pngthere you can see all posts are displaying
but when i try to make that new page as a home page using "Reading Settings" home page gone blank
http://www.bargainblessings.com/wp-content/uploads/2017/10/1-1.png
http://www.bargainblessings.com/wp-content/uploads/2017/10/1-2.pngOctober 11, 2017 at 11:23 pm #212453ramesh85MemberLet me know why?
October 15, 2017 at 8:32 am #212447ramesh85MemberMy code Part for blog template:
<?php
/**
* Template Name: Blog Template
* Description: Used as a page template to show page contents, followed by a loop
* through the "Genesis Office Hours" category
*/// Add our custom loop
add_action( 'genesis_loop', 'cd_goh_loop' );function cd_goh_loop() {
$args = array( 'post_type' => 'post', 'posts_per_page' => 10, 'orderby' => 'menu_order');
$loop = new WP_Query( $args );
if( $loop->have_posts() ) {// loop through posts
while( $loop->have_posts() ): $loop->the_post();$video_id = esc_attr( genesis_get_custom_field( 'cd_youtube_id' ) );
$video_thumbnail = '';
$video_link = 'http://www.youtube.com/watch?v=' . $video_id;echo '<div class="one-third first">';
echo '' . $video_thumbnail . '';
echo '</div>';
echo '<div class="two-thirds">';
echo '<h4>' . get_the_title() . '</h4>';
echo '<p>' . get_the_date() . '</p>';
echo '<p>Watch It | Show Notes</p>';
echo '</div>';endwhile;
}wp_reset_postdata();
}
genesis();
?>
*******************************************************
i created a page name called New and i assign this template for new page :
https://www.bargainblessings.com/new/ (you can see posts are displaying there)
screenshot 1:
http://www.bargainblessings.com/wp-content/uploads/2017/10/1-3.pngbut when i select this new page as a home in Reading Settings section these post are not displaying there.
screenshot 1:
http://www.bargainblessings.com/wp-content/uploads/2017/10/1-1.pngscreenshot 2:
http://www.bargainblessings.com/wp-content/uploads/2017/10/1-2.pnglet me know why custom blog template not working on home page ?
October 16, 2017 at 11:37 pm #212593ramesh85Memberhi could you please check? i have updated my custom code and setting screenshots.
thank you
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.