Community Forums › Forums › Archived Forums › General Discussion › PHP Help w/Code
Tagged: code, Mocha, recent posts
- This topic has 5 replies, 2 voices, and was last updated 11 years, 4 months ago by
Brad Dalton.
-
AuthorPosts
-
November 25, 2013 at 6:55 am #75494
liannef
MemberHow do I display thumbnails in the following code?
http://www.themakeupgirl.net<?php /* Template Name: Recent Post */ ?> <?php get_header(); ?> Thank you for visiting the <strong>Archives</strong>!! I have listed the 200 most recent posts here, there are over 2,000 posts to comb through so take your time, sit a spell, take a load off! Want to know what my very first post was? It was on April 15, 2006 about my obsession with <a href="http://themakeupgirl.net/lip-balm/obession-lip-balm/"><strong>Lip Balm.</strong></a> If there is something specific you are looking for, I have the most <strong>Popular Categories</strong> in a drop down set up on the top navigation. You can also use the search box at the top right of the page to search by keyword. Any questions? Just email me <a href="mailto:[email protected]"><strong>[email protected].</strong></a> <ul> <?php $args = array( 'numberposts' => '200' ); $recent_posts = wp_get_recent_posts( $args ); foreach( $recent_posts as $recent ){ echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.$recent["post_title"].'" >' . $recent["post_title"].'</a> </li> '; } ?> </ul> <?php get_sidebar(); get_footer(); ?>
November 25, 2013 at 8:50 am #75512Brad Dalton
ParticipantWhy not simply use the blog page template and set it to display 200 posts with the featured image?
Or use a widget in a template with the Genesis Featured posts widget?
November 25, 2013 at 9:30 am #75515liannef
MemberHi There! I figured that out, and I have it set with the blog page template BUT I don't know how to add an intro paragraph at the top without trampling all over the breadcrumbs. I actually used your code at the suggestion of another member in my functions php to set up a widget that would appear before posts but now the breadcrumbs are below it
November 25, 2013 at 10:05 am #75522Brad Dalton
Participant<?php /** * * Template Name: Custom Blog * This file handles blog post listings within a page. * * @author Jen Baumann * @link http://dreamwhisperdesigns.com/?p=1011 * @package Genesis */ add_action('genesis_loop', 'genesis_standard_loop', 8); //* Remove breadcrumbs remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); genesis();
Source http://dreamwhisperdesigns.com/genesis-tutorials/add-content-genesis-blog-page-template/
Then you can use some of these snippets in the custom blog page template to customize your page
http://my.studiopress.com/snippets/
November 25, 2013 at 2:48 pm #75569liannef
MemberThank you! Do I add this to my functions.php or is this in place of the other code I added earlier?
This is what I have currently
/** Register Before Posts widget area On Blog Page Only**/ genesis_register_sidebar( array( 'id' => 'before-blog', 'name' => __( 'Before Blog Widget', 'wpsites' ), 'description' => __( 'This is the before post widget area on the blog page only.', 'wpsites' ), ) ); /** * @author Brad Dalton - WP Sites * @link http://wp.me/p1lTu0-9Jr */ /** Before Posts On Blog Page Only*/ add_action( 'genesis_before_loop', 'wpsites_before_blog_widget', 9 ); function wpsites_before_blog_widget() { if ( is_page( '22714' ) ) { echo '<div class="before-blog">'; dynamic_sidebar( 'before-blog' ); echo '</div><!-- end .before-blog -->'; } }
November 25, 2013 at 5:31 pm #75598Brad Dalton
Participant -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.