treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Wordpress post - list style not working

  • I just bought a wordpress theme and I am trying to customize it a bit. I know html and css fairly well but have not done much Wordpress.

    When I post to the blog, the list button not not make the text into a list on the main blog page. It instead puts it in one line. Like so...

    item 1 item 2 item 3

    When i look at the html editor it says that it is indeed using html to specify a list.

    When I go to the "single" page it displays it correctly like so...

    item 1
    item 2
    item 3

    So I am trying to figure out what makes it display differently on those two pages. Here is the code.

    BLOG TEMPLATE
    <div id="main" style="padding-top:<?php echo wip_check_logo_height(); ?>;">
    <div class="wrap">

    <div id="main-bg">

    <div id="main-area">

    <h1 id="page-title"><span><?php single_post_title(); ?></span></h1>

    <div class="normal-content with-sidebar">

    <div id="the-content">

    <?php
    $an_blog_perpage = intval( get_wip_option_by('xe_blog_ppp', '5') );

    $args=array(
    'post_type' => 'post',
    'post_status' => 'publish',
    'posts_per_page' => $an_blog_perpage,
    'ignore_sticky_posts' =>1,
    'paged' =>$paged,
    );
    query_posts($args);

    while (have_posts()): the_post();
    ?>

    <div class="blog-lists">

    <?php if( has_post_thumbnail()) { ?>

    <div class="blog-thumb">

    <a class="featured-image" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
    <img src="<?php echo get_thumbOri( $post->ID, 'bloglists' ); ?>" alt="<?php the_title_attribute(); ?>" />
    </a>

    </div>

    <?php } ?>

    <h2 class="blog-lists-title"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    <span class="post-by">
    <?php print __('By', 'wip'); ?> <?php the_author_posts_link(); ?>
    <?php print __('on', 'wip'); ?> <?php the_time('F d, Y'); ?>
    / <?php comments_popup_link( __('Leave a comment', 'wip'), __('1 Comment', 'wip'), __('% Comments', 'wip') ); ?>
    </span>

    <?php wip_blog_printcontent(); ?>

    <div class="blog-lists-more">
    <span class="posted-in">
    <?php print __('Posted in:', 'wip') ?> <?php the_category(', '); ?>
    </span>

    <span class="posted-more">
    <a class="read-more-blog" href="<?php the_permalink(); ?>" title="" >
    <?php echo get_wip_option_by('xe_blog_rm', 'read more'); ?>
    </a>
    </span>
    </div>

    </div>

    <?php

    endwhile;

    wip_pagenavi();

    wp_reset_query();

    ?>

    </div>

    <!-- start sidebar -->
    <?php get_sidebar(); ?>
    <!-- end sidebar -->

    </div>

    </div><!-- end #main-area -->

    </div><!-- end #main-bg -->

    </div><!-- end .wrap -->
    </div>

    <?php get_footer(); ?>



    SINGLE POST PAGE
    <?php get_header(); ?>

    <div id="main" style="padding-top:<?php echo wip_check_logo_height(); ?>;">
    <div class="wrap">

    <div id="main-bg">

    <div id="main-area" <?php post_class(); ?>>

    <div class="normal-content with-sidebar single">

    <div id="the-content">

    <?php
    if(have_posts()):

    while (have_posts()): the_post();
    ?>

    <div class="blog-lists single">

    <h2 class="blog-single-title"><?php the_title(); ?></h2>
    <span class="post-by">
    <?php print __('By', 'wip'); ?> <?php the_author_posts_link(); ?>
    <?php print __('on', 'wip'); ?> <?php the_time('F d, Y'); ?>
    &#8212; <?php comments_popup_link( __('Leave a comment', 'wip'), __('1 Comment', 'wip'), __('% Comments', 'wip') ); ?>
    </span>

    <?php if( has_post_thumbnail() && get_post_meta($post->ID, '_disable_thumbnail', true) !== "1" ) { ?>

    <div class="blog-thumb">

    <a class="featured-image" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
    <img src="<?php echo get_thumbOri( $post->ID, 'bloglists' ); ?>" alt="<?php the_title_attribute(); ?>" />
    </a>

    </div>

    <?php } ?>

    <?php the_content(); ?>

    <div class="blog-lists-more">
    <span class="posted-in">
    <?php print __('Posted in:', 'wip') ?> <?php the_category(', '); ?>
    </span>

    <?php
    $tags_list = get_the_tag_list( '', ', ' );
    if ( $tags_list ):
    ?>
    <span class="single-tag">
    <?php printf( __( 'Tagged : %1$s', 'wip' ), $tags_list ); ?>
    </span>
    <?php endif; ?>
    </div>

    </div>

    <?php
    comments_template( '', true );
    ?>

    <?php

    endwhile;

    endif;

    wp_reset_query();

    ?>

    </div>

    <!-- start sidebar -->
    <?php get_sidebar(); ?>
    <!-- end sidebar -->

    </div>

    </div><!-- end #main-area -->

    </div><!-- end #main-bg -->

    </div><!-- end .wrap -->
    </div>

    <?php get_footer(); ?>


    I would be grateful for any info to point me in the right direction.
  • I'm guessing there is a float or display specified for lists. Take a look at the CSS. Also if you have a link to a live site we will be able to help more.
  • Thanks @stevencrader. I have looked through the css but I am not finding the code to make this happen.

    Here is the link http://wp-testing.bopedesign.com/?page_id=104
  • Looking at the source of the (live) front page and single page is appears on the front page it is showing displaying <p>item 1 item 2 item 3</p> rather than as a list.

    Is it set to only display the excerpt on the front page? can you toggle this option to see if you can tell if this is the source of the problem?
  • On the front page, the content is written by using this code:

    <?php wip_blog_printcontent(); ?>
    This seems to strip the content from some tags, if you look in the source code of your page you'll see that there's not even any UL or LI tags anymore.

    Not sure if this a plugin or part of your theme, but if you replace it with:

    <?php the_excerpt(); ?>
    or:

    <?php the_content(); ?>
    (like it is in your single post template), you should be fine.

    (BTW, the blue font on black background is a little hard on the eyes)