PHP Help w/Code

Community Forums Forums General Discussion PHP Help w/Code

This topic is: resolved

This topic contains 5 replies, has 2 voices, and was last updated by  braddalton 11 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #75494

    liannef
    Member
    Post count: 39

    How do I display thumbnails in the following code?

    <?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:lianne@themakeupgirl.net"><strong>lianne@themakeupgirl.net.</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();
    ?>
    • This topic was modified 11 months ago by  liannef.
    • This topic was modified 11 months ago by  liannef.
    http://www.themakeupgirl.net
    #75512

    braddalton
    Participant
    Post count: 10243

    Why 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?


    #75515

    liannef
    Member
    Post count: 39

    Hi 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

    http://www.themakeupgirl.net/archives

    #75522

    braddalton
    Participant
    Post count: 10243

    [php]
    <?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();
    [/php]

    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/


    #75569

    liannef
    Member
    Post count: 39

    Thank 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 -->';
    
    	}
    
    }
    #75598

    braddalton
    Participant
    Post count: 10243

    To a new page template named page_blog.php


Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.