Forums

How to populate blog with posts (17 posts)

  1. brownday
    Member
    Posted 1 year ago #

    I've successfully styled the blog the way I want it to look but posts aren't showing up. Here it is: http://bit.ly/9Y59ZL

    Any suggestions?

    Thanks

  2. brownday
    Member
    Posted 1 year ago #

    The template code for the template it has now is:

    <?php
    /*
    Template Name: Blog
    */
    ?>
    
    <?php get_header(); ?>
    
    <?php if (get_option('ebusiness_categories') == 'on') : ?>
    	<div id="categories"> <img src="<?php bloginfo('template_directory'); ?>/images/categories-left-<?php echo $ebusiness_color_scheme; ?>.gif" alt="line" style="float: left;" />
    		<?php $menuClass = 'nav superfish';
    		$menuID = 'nav2';
    		$secondaryNav = '';
    		if (function_exists('wp_nav_menu')) {
    			$secondaryNav = wp_nav_menu( array( 'theme_location' => 'secondary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false ) );
    		};
    		if ($secondaryNav == '') { ?>
    			<ul id="<?php echo $menuID; ?>" class="<?php echo $menuClass; ?>">
    				<?php show_categories_menu($menuClass,false); ?>
    			</ul> <!-- end ul#nav -->
    		<?php }
    		else echo($secondaryNav); ?>
    		<img src="<?php bloginfo('template_directory'); ?>/images/categories-right-<?php echo $ebusiness_color_scheme; ?>.gif" alt="line" style="float: left;" /> </div>
    <?php endif; ?>
    
    <div id="container">
    
        <div id="left-div">
            <?php if (get_option('ebusiness_full_post') == 'on') { ?>
            <?php include(TEMPLATEPATH . '/includes/blogstyle.php'); ?>
            <?php } else { include(TEMPLATEPATH . '/includes/defaultindex.php'); } ?>
        </div>
        <?php get_sidebar(); ?>
        <img src="<?php bloginfo('template_directory'); ?>/images/content-bg-<?php echo $ebusiness_color_scheme; ?>.gif" alt="line" style="float: left; margin-top: 15px;" /> </div>
    <?php get_footer(); ?>
    </body></html>
    
    <?php
    if (is_archive()) $post_number = get_option('ebusiness_archivenum_posts');
    if (is_search()) $post_number = get_option('ebusiness_searchnum_posts');
    if (is_tag()) $post_number = get_option('ebusiness_tagnum_posts');
    if (is_category()) $post_number = get_option('ebusiness_catnum_posts');
    if (is_home()) $post_number = get_option('ebusiness_blogstyle_homeposts');
    global $query_string; query_posts($query_string . "&showposts=$post_number&paged=$paged");
    ?>

    Am I missing something to have the posts populate it?

    Thanks in advance!

  3. tom_taylor_85
    Member
    Posted 1 year ago #

    Your missing the posts loop

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                   <!-- do stuff ... -->
                   <?php endwhile; ?>
         <?php endif; ?>
  4. brownday
    Member
    Posted 1 year ago #

    Where would I insert this between from the code I pasted?

  5. tom_taylor_85
    Member
    Posted 1 year ago #

    It honestly all depends...what do you want as part of your loop? You want the title? excerpt? thumbnail? what?

  6. brownday
    Member
    Posted 1 year ago #

    I tried pasting them into several areas but can't seem to get it work =/

  7. brownday
    Member
    Posted 1 year ago #

    I just want the entire post.. Title and date would be perfect

  8. tom_taylor_85
    Member
    Posted 1 year ago #

    what do you want inside your loop is what i mean?

  9. brownday
    Member
    Posted 1 year ago #

    the title, author, thumbnail would be ideal.. i really don't need an excerpt or anything like that

  10. tom_taylor_85
    Member
    Posted 1 year ago #

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <!-- Thumbnail -->
    <?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
    <a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" width="85" border="1" style="float:left;margin:0px 10px 0px 0px;" /></a>
    
            <?php else: ?>
    
           <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a>
            <?php endif; ?>
    <!-- End Thumbnail -->
    
    <!-- Title -->
     <b><a href="<?php the_permalink() ?>" rel="bookmark">
           <?php the_title(); ?></b></a>
    <!-- End Title -->
    
    <!-- Date -->
    <?php the_time('F jS, Y') ?
    <!-- End Date -->
    
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>

    Thats not the author, just thumbnail, title, date.

    Try pasting after the get_header

  11. tom_taylor_85
    Member
    Posted 1 year ago #

    Wait a second, I saw your parse error.....where are you pasting this code???

  12. brownday
    Member
    Posted 1 year ago #

    The blog looks like this after pasting the header code: http://bit.ly/9Y59ZL

    Some progress, no? =)

  13. tom_taylor_85
    Member
    Posted 1 year ago #

    hmmm....one sec

    Where did you get this theme from?

  14. brownday
    Member
    Posted 1 year ago #

  15. tom_taylor_85
    Member
    Posted 1 year ago #

    This is the simple loop I use, it doesn't include font sizes or any div classes. It has the thumbnail, category, title, excerpt, edit link, and the date.

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    	<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
    	<a href="<?php the_permalink() ?>" rel="bookmark"></a> 
    
        <?php endif; ?>
    <td width="154"><a href="<?php the_permalink(); ?>"><img src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" width="150" /></a></td>
    <?php the_category(', ') ?>
    	    <?php the_time('F jS, Y') ?>
          <a href="<?php the_permalink() ?>" rel="bookmark">
            <?php the_title(); ?></a>
    <?php the_excerpt();?>
                  <?php edit_post_link('Edit','',''); ?>
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?>
      <?php endif; ?>
  16. MAS
    Member
    Posted 1 year ago #

    your blog content should be came from this section

    <div id="left-div">
            <?php if (get_option('ebusiness_full_post') == 'on') { ?>
            <?php include(TEMPLATEPATH . '/includes/blogstyle.php'); ?>
            <?php } else { include(TEMPLATEPATH . '/includes/defaultindex.php'); } ?>
        </div>

    Check two files(blogstyle.php, defaultindex.php) throughly. Also check theme setting option from admin.

  17. brownday
    Member
    Posted 1 year ago #

    Ok, so I got the website working the way I wanted it to. What I did was go into Reading > Static page

    Home page would be a standard home page and the blog page would obviously be blog. I turned on the blog style option in the control panel.

    I duplicated the default.php file and made that into a home page template for my first page. The posts seem to be working fine now.

    Thanks for all your help guys!!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags