I had this site all together and then changed the menu to a simple <ul> multi-level CSS menu and am in trouble all over again…
I can swear it was working fine on all pages, but maybe I was wrong. It’s just fine on the home page but disappears on other pages and I just can’t figure out why. I blame some WordPress plug-in, but they are the same on all pages so that doesn’t make sense. The code fails the validator miserably due to 3rd party plug-ins and links, so that doesn’t make it easier, but again, the menu works on the home page.
By the way, the WP Codex has some helpful information on it, even if it is somewhat out of date. Also, the forums there are chock full of stuff that is useful
<!-- lastest from the blog -->
<h1 class="home">FROM THE BLOG
<span class="links">
<img src="<?php bloginfo('template_url'); ?>/images/ico_rss.png" alt="RSS" /><a href="<?php bloginfo('rss2_url'); ?>">RSS Feed</a> |
<a href="<?php echo get_category_link(get_option('wise_blog_id') )?>">Visit our blog »</a>
</span>
</h1>
<ul class="latestPosts">
<?php
if(get_option('wise_latest_posts')!=''){
$posts_query = new WP_Query($query_string.'&cat='.get_option('wise_blog_id').'&orderby=date&showposts='.get_option('wise_latest_posts'));
}else{
$posts_query = new WP_Query($query_string.'&cat='.get_option('wise_blog_id').'&orderby=date&showposts=4');
}
if ($posts_query -> have_posts()) : while ($posts_query -> have_posts()) : $posts_query -> the_post();
?>
<li>
<img src="<?php if ( function_exists('p75GetThumbnail') )echo p75GetThumbnail($post->ID); ?>" alt="<?php the_title(); ?>" /><a href="<?php the_permalink(); ?>"><strong><?php the_title(); ?></strong></a>
<br />
<?php content('25'); ?>
<br /><span>Posted on <?php the_time('F j, Y') ?></span>
</li>
<?php endwhile;
endif;
?>
</ul>
</div>
<!-- end colLeft -->
See the <?php content(‘25’); ?> towards the bottom? That is what is grabbing the content of your blog posts. It’s also grabbing all of the html code. I’m not sure if this works on content(); or not, but try this:
What this does is fixes the_excerpt() up to get rid of all markup, adds <p> tags instead of <br /> tags, shortens it to 25 words and adds “[…]” to the end of the post. This is what I use on a blog of mine.
Hey smarsh! Could you post the code for that section of your site… We may be able to figure it out, just need to see what the php is doing there I guess.
Yeah - no response from the WP forum - I think CSS is one of the best forums here.
I searched everywhere and never found a blockquote and looked into the_loop(); and the_excerpt(); but couldn’t figure out anything. Here’s the section of code from the home page, but I’m not sure it will be helpful:
<?php get_header(); ?>
<!-- home header -->
<div id="homeHeader">
<?php /*?><?php include (TEMPLATEPATH . '/home_header.php'); ?>removed<?php */?>
</div>
<!-- end home header -->
<!-- features -->
<?php $feature1=get_post(get_option('wise_feature1'));
$feature2=get_post(get_option('wise_feature2'));
$feature3=get_post(get_option('wise_feature3'));
if(get_option('wise_feature1')!= null && get_option('wise_feature2')!= null && get_option('wise_feature3')!= null){?>
<div id="features" class="clearfix">
<div class="featuresInner first">
<h2><?php echo $feature1->post_title?></h2>
<?php echo apply_filters('the_content', $feature1->post_content);?>
</div>
<div class="featuresInner">
<h2><?php echo $feature2->post_title?></h2>
<?php echo apply_filters('the_content', $feature2->post_content);?>
</div>
<div class="featuresInner">
<h2><?php echo $feature3->post_title?></h2>
<?php echo apply_filters('the_content', $feature3->post_content);?>
</div>
</div>
<div id="featuresBottom"></div>
<?php }?>
<!-- end features -->
<!-- begin colLeft -->
<div id="colLeft">
<!-- home custom content -->
<?php if(get_option('wise_home_content')) {
$homecontent=get_post(get_option('wise_home_content'));?>
<h1 class="home"><?php echo $homecontent -> post_title?></h1>
<?php echo apply_filters('the_content', $homecontent->post_content);?>
<?php }?>
<!-- lastest from the blog -->
<h1 class="home">FROM THE BLOG
<span class="links">
<img src="<?php bloginfo('template_url'); ?>/images/ico_rss.png" alt="RSS" /><a href="<?php bloginfo('rss2_url'); ?>">RSS Feed</a> |
<a href="<?php echo get_category_link(get_option('wise_blog_id') )?>">Visit our blog »</a>
</span>
</h1>
<ul class="latestPosts">
<?php
if(get_option('wise_latest_posts')!=''){
$posts_query = new WP_Query($query_string.'&cat='.get_option('wise_blog_id').'&orderby=date&showposts='.get_option('wise_latest_posts'));
}else{
$posts_query = new WP_Query($query_string.'&cat='.get_option('wise_blog_id').'&orderby=date&showposts=4');
}
if ($posts_query -> have_posts()) : while ($posts_query -> have_posts()) : $posts_query -> the_post();
?>
<li>
<img src="<?php if ( function_exists('p75GetThumbnail') )echo p75GetThumbnail($post->ID); ?>" alt="<?php the_title(); ?>" /><a href="<?php the_permalink(); ?>"><strong><?php the_title(); ?></strong></a><br /> <?php content('25'); ?>
<br /><span>Posted on <?php the_time('F j, Y') ?></span>
</li>
<?php endwhile;
endif;
?>
</ul>
</div>
<!-- end colLeft -->
I’m stuck (as usual) on this and really appreciate the help!
If you want to fix the indent you’ll have to fix up your margins. Now, if you want to get rid of the final line, you’ll have to get rid of all of them. Here is some new code to update your style.css with that fixes both of your issues.
Thanks guys! I just did not see that. I changed the CSS path to the dynamic PHP path so all pages find it the same.
One last thing I just don’t see:
On the home page there’s a section “from the blog”. With the exception of FF and Opera, it indents each listing after the first. In FF and Opera, they all are aligned equally to the left. How can I get rid of the indent and the extra <hr> at the bottom of the list?
The dropdown.css is only working on the home page, all other pages are not picking it up.
It looks like you have the file path the same on all other pages but neither Firebug or WebDev show the dropdown.css on any page besides the home page.
Your first list item has an miss-closed blockquote & em tag and is screwing up the format.
<blockquote>
<em>Dear Sandy,</em>
<em>How do I get past my run of bad luck and get my practice back on track?</em>
<em>It seems that every time I get close
<br />
<span>Posted on August 16, 2010</span>
</li>
So, the DOM is seeing every subsequent list item as a nested list item and still part of the first one.