GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Calling Wordprss genius's again! Conditional includes on category page 1? (https://gfy.com/showthread.php?t=953636)

Angry Jew Cat - Banned for Life 02-13-2010 01:15 PM

Calling Wordprss genius's again! Conditional includes on category page 1?
 
I understand how to do a conditional include to display on many different pages, but I would like to have an included div associated to each category on my site. That's easy enough, but I would like that condition to include that the div should only be included on THE FIRST PAGE of the category display.

Is that doable, or will my included div only be able to show on each page of the category listing?

fris 02-13-2010 02:18 PM

not sure if you want an include or what, but you want to use the variable is_paged()

Code:

<?php if (is_category() && !is_paged()) { ?>

<div class="stuff">
blah blah
</div>

or

<?php include (TEMPLATEPATH . '/showdiv.html'); ?>

<?php } ?>


Angry Jew Cat - Banned for Life 02-13-2010 02:33 PM

Quote:

Originally Posted by fris (Post 16847901)
not sure if you want an include or what, but you want to use the variable is_paged()

Code:

<?php if (is_category() && !is_paged()) { ?>

<div class="stuff">
blah blah
</div>

or

<?php include (TEMPLATEPATH . '/showdiv.html'); ?>

<?php } ?>


What I want is a single area for includign a category description, but I only want it to appear at the top of the first page of the category results. Not the description on the top of every page under the category listing.

I'll google the is_paged() variable now and see what it has to say. Never used it before. Might work.

fris 02-13-2010 02:37 PM

well that will do it

fris 02-13-2010 02:38 PM

if you wanted to do an automated msg with the cat name you would do something like this.

Code:

<?php if (is_category() && !is_paged()) { ?>
<?php $catid = get_query_var('cat'); ?>
<?php $catname = get_cat_name($catid);?>

<div class="message">
welcome to the archives for <?php echo $catname;?>
</div>

<?php } ?>


Angry Jew Cat - Banned for Life 02-13-2010 02:50 PM

cheers, thanks again fris

fris 02-13-2010 03:20 PM

no problem.


All times are GMT -7. The time now is 04:58 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc