go41

Re: Changing category „belt“ in Arthemia to a static page :: Reply by Joern

von Joern am 23. Jun. 2010 | Keine Kommentare

okay, I will put it at the end of the row.
you have to modify this part in index.php, should still look similar like this now:

Code:

<div id="middle" class="clearfloat">
   <img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/category.png" class="clearfloat" alt="" />
   <?php $display_categories = array(9,10,11,12,xx); $i = 1;
   foreach ($display_categories as $category) { ?>

   <div id="cat-<?php echo $i; ?>" class="category">
      <?php query_posts("showposts=1&cat=$category")?>
      <span class="cat_title"><a href="<?php echo get_category_link($category);?>"><?php single_cat_title(); ?></a></span>
      <a href="<?php echo get_category_link($category);?>"><?php echo category_description($category); ?></a>
   </div>

   <?php $i++; ?>
       <?php } ?>

   </div>

I will remove one category in that row, so there is only 4four left, 9,10,11,12

this $i = 1 counts only how often you run the query to put out div id="cat-<?php echo $i; ?>", reads div id="cat-1" to cat-4 now

finally just put a new query for one page (win) just below, having the div id="cat-5",

querying for ‚win‘, bring the title and the excerpt in the respective span classes

The except might be too long, you should use a custom excerpt with the length you like.

here the new code to replace exactly the stuff above:

Code:

<div id="middle" class="clearfloat">
   <img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/category.png" class="clearfloat" alt="" />
   <?php $display_categories = array(9,10,11,12); $i = 1;
   foreach ($display_categories as $category) { ?>

   <div id="cat-<?php echo $i; ?>" class="category">
      <?php query_posts("showposts=1&cat=$category")?>
      <span class="cat_title"><a href="<?php echo get_category_link($category);?>"><?php single_cat_title(); ?></a></span>
      <a href="<?php echo get_category_link($category);?>"><?php echo category_description($category); ?></a>
   </div>

   <?php $i++; ?>
         <?php } ?>

   <div id="cat-5" class="category">
      <?php query_posts('pagename=win'); //retrieves the win page only ?>
      <span class="cat_title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"></span>
      <a href="<?php the_permalink() ?>"><?php the_excerpt(); ?></a>
   </div>

</div>

Did not try it, hope no typing error, but should work..

good luck an BACKUP!! first
____________________
you find me on Google+, Twitter and Facebook

(von: Joern)

Hier noch 3 weitere Ergebnisse dieses Threads:

Changing category „belt“ in Arthemia to a static page

22. Jun. 2010 (von: drwhom)

Hi Joern - me again! I know I've seen this elsewhere but I can't find it - have you got the code tweak for changing the category belt so that one of the 5 links goes to a static page?…

Re: Changing category „belt“ in Arthemia to a static page :: Reply by master

22. Jun. 2010 (von: master)

you want 4 links going to a category and one to a page?If the page is the first or the last in this row, it will be easier, otherwise being displayed somewhere between mor difficult, what do you want?I need…

Re: Changing category „belt“ in Arthemia to a static page :: Reply by drwhom

23. Jun. 2010 (von: drwhom)

Howdy - the page could be linked as either the first or the last, I'm happy either way. Cat nos:9,10,11,12Single page 'win' (www.iamstaggered.com/win) Weiterlesen →

Autor:

Du findest mich auch auf Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.


Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.

weitere forum Beiträge: