I really don’t know PHP, but I know I need to work it into a conditional statement, maybe on this line?
else the_content('Read the rest of this entry »');
https://www.montanalightphotography.com/misc/index.txt
]]>I am trying to make a mullet loop, but I only want the “business” to display on the very first page of my loop.
I have tried using is_home() or is_front_page(), but they return true even if i have moved to the “previous entries page” (/pages/2)
If you take a look at www.agamersodyssey.com you can see what I mean when moving to those previous pages.
Any idea what I can do to achieve this?
Simon
]]>Anyway, here’s what I have come up with (this is the relevant part of the template file that I edited):
<?php
// to count posts inside WP loop
$postCount=0;
// number of full posts to display
$displayNumPosts = 3;
?>
<?php
// WP loop
if(have_posts()) : while (have_posts()) : the_post();
?>
<?php
if($postCount<$displayNumPosts) {
?>
<div id="content">
<div class="post" id="post-<?php the_ID(); ?>">
<div class="date"> <br/><?php the_time('d') ?>
<?php the_time('M') ?> </div><h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
<div class="entry">
<?php the_content('Continue Reading »'); ?>
</div>
<p class="postmetadata">Posted in <?php the_category(', ') ?> <strong>|</strong> <?php edit_post_link('Edit',' ','<strong> |</strong>'); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> Posted by: <?php the_author() ?>
</div>
</div>
<!-- ...............content ends, sidebar right begins ............... -->
<div id="sidebars">
<div id="rightnav">
<?php } else { ?>
<ul id="sidebarright">
<li>
<h2><a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a></h2>
<?php the_time('j F y') ?></li>
<?php } ?>
</ul>
<?php
// increment $postCount
$postCount++;
?>
<?php
// WP loop ends
endwhile; endif;
?>
</div>
<!-- ...............sidebar right ends, sidebar left begins ............... -->
Obviously, there was something wrong with that. I think the html is in the wrong place.
Here’s what it used to be:
<div id="content">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<div class="date"> <br/><?php the_time('d') ?>
<?php the_time('M') ?> </div><h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
<div class="entry">
<?php the_content('Continue Reading »'); ?>
</div>
<p class="postmetadata">Posted in <?php the_category(', ') ?> <strong>|</strong> <?php edit_post_link('Edit',' ','<strong> |</strong>'); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> Posted by: <?php the_author() ?>
</div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Next Entries »') ?></div>
</div>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.
<?php include (TEMPLATEPATH . "/searchform.php"); ?>
<?php endif; ?>
</div>
<!-- ...............content ends, sidebar right begins ............... -->
<div id="sidebars">
<div id="rightnav">
<ul id="sidebarright">
<li><h2>Titel</h2>
Hier komen de vorige posts. Nou ja, hun titels dan. Daar kun je dan op klikken en dat is dan heel handig. Nu staat er nog niks, helaas. Waarom lees je dit eigenlijk? Het is niet alsof hier iets interessants staat. Toast is trouwens lekker, met hagelslag of pindakaas bijvoorbeeld.</li>
</ul>
</div>
<!-- ...............sidebar right ends, sidebar left begins ............... -->
I hope someone can help me with this, because I would greatly appreciate it. Thanks in advance. Regards,
Robin
]]>This style of listing posts is considered “mullet” style (long-tail) and is a user-friendlier way of showing users your other posts than the sidebar calendar (which shows when a post was made, but not what it was about) or the monthly archive list (which requires users to browse by month).
It’s my first plugin, so feel free to give it a try, offer suggestions or comments, etc.
]]>I have created a new theme based on the WordPress default (Kubrick) theme that follows the Mullet-style blog layout (www.jonathanboutelle.com/mt/archives/2005/08/mulletstyle_blo.html).
Use/modify it as you like.
The latest version of the theme can be downloaded from https://gopalarathnam.com/software/.
—
Gopalarathnam Venkatesan