Community Forums › Forums › Archived Forums › General Discussion › Custom Blog page with pagination
- This topic has 4 replies, 2 voices, and was last updated 9 years, 4 months ago by pxforti.
-
AuthorPosts
-
July 6, 2015 at 12:40 pm #158533webmestre-cgmataneMember
Hello,
I'm trying to find out how to customize my blog posts (on my /blog page) to get a result like that :
In fact i'm trying to list all my posts (10 posts by page)
I dont really understand where i should begin, i'm pretty new with genesis i would like some help. should i create a template with a custom loop ?
thx
July 6, 2015 at 2:20 pm #158548pxfortiParticipantCan't see the image for the results you want. do you have a url. Also, do you have a url for your live site?
writeNowDesign
WordPress and Ecommerce Website DesignJuly 6, 2015 at 3:39 pm #158553webmestre-cgmataneMembersorry
I'm looking for a WP QUERY with pagination that could work on /blog page and with archives and categories
July 6, 2015 at 5:09 pm #158575webmestre-cgmataneMemberI'm trying this code but its not working im kinda lost :
<?php //* Template Name: PAGES NOUVELLES (BLOG) //* The blog page loop logic is located in lib/structure/loops.php /** Force full width layout **/ add_filter ( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' ); // Add specific CSS class by filter add_filter( 'body_class', 'my_class_names' ); function my_class_names( $classes ) { // add 'class-name' to the $classes array $classes[] = 'blog'; // return the $classes array return $classes; } remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop add_action( 'genesis_loop', 'custom_do_loop' ); // Add custom loop function custom_do_loop() { global $post; // arguments, adjust as needed $args = array( 'post_type' => 'post', 'posts_per_page' => 10, 'post_status' => 'publish', 'paged' => get_query_var( 'paged' ) ); global $wp_query; $wp_query = new WP_Query( $args ); if ( have_posts() ) : echo '<ul>'; while ( have_posts() ) : the_post(); ?> <article id="" itemscope="itemscope" itemtype="http://schema.org/Article"> <div class="one-third first"> <a href="" itemprop="thumbnailURL"><img src="" alt="" class="" /></a> </div> <div class="two-thirds"> <h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> <div class="meta"></div> <div class="resume" itemprop="about"></div> <div class="read-more" propname="url"></div> </div> </article> <?php endwhile; echo '</ul>'; do_action( 'genesis_after_endwhile' ); endif; wp_reset_query(); ?> <?php } genesis();
July 7, 2015 at 7:13 am #158652pxfortiParticipantHi,
I think there's an easier way to do it and still use the genisis blog features and settings.
The trick is to find out how your blog content is being displayed. I used if( is_archive) but you might have to use a different conditional.
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); // removed default genesis featured/post image code add_action( 'genesis_before_entry_content', 'featured_post_image' ); add your custom featured post image code function featured_post_image() { if (is_archive( )) { ?> <div class="archive_thumb alignleft"> <?php the_post_thumbnail('thumbnail'); //you can use thumbnail, medium, large or a custom size ?> </div> <?php } }
writeNowDesign
WordPress and Ecommerce Website Design -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.