go41

Re: Adding an extra heading to the Featured section :: Reply by Joern

von Joern am 27. Mrz. 2010 | Keine Kommentare

Sharon, to get the image ‚Spotlight‘ you see in the sample, just right click it and save somewhere on your PC. It has to go as ’spotlight2.png‘ into the folder /arthemia/images/ in your site. There should also be featured.png and headline.png.

The font used for these images is called District Thin, here: http://www.philsfonts.com/freefont.html

I just thought all these 3 images looking like your titles font would be nice too.
The code I give you here goes into the template file index.php

MAKE A BACKUP FIRST OF YOUR FILE AS IT IS BEFORE EDITING!!

Now look for

Code:

<div id="featured"> and <div id="middle" class="clearfloat">

we are going to replace these two lines including all stuff in between.

After replacing you should just have once <div id="featured"> before and once

Code:

<div id="middle" class="clearfloat"> after the replacement. Difficult??
<div id="featured">
<!-- old code but display only two posts of Featured category showposts=2&category_name=Featured -->
   <img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/featured.png" width="72px" height="17px" alt="" />

   <?php query_posts("showposts=2&category_name=Featured"); $i = 1; ?>

         <?php while (have_posts()) : the_post(); ?>
   <div class="clearfloat">
   <?php $values = get_post_custom_values("Image");
   if (isset($values[0])) { ?>
      <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
   <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
$values = get_post_custom_values("Image"); echo $values[0]; ?>&w=100&h=65&zc=1&q=100"
alt="<?php the_title(); ?>" class="left" width="100px" height="65px"  /></a>
      <?php } ?>
   <div class="info"><a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php the_title(); ?></a>
<div class="meta">[<?php the_time('j M Y') ?> | <?php comments_popup_link('No Comment', 'One Comment', '% Comments');?> | <?php if(function_exists('the_views')) { the_views(); } ?>]</div>   

</div>
       </div>

      <?php endwhile; ?>

<!-- end of old code and start of new code to show one more 'title image' spotlight2.png and two posts of another category -->

   <img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/spotlight2.png" width="76px" height="19px" alt="" />

   <?php query_posts("showposts=2&category_name=Gallery"); $i = 1; // replace Gallery with the name of one of your categories ?>

         <?php while (have_posts()) : the_post(); ?>
   <div class="clearfloat">
   <?php $values = get_post_custom_values("Image");
   if (isset($values[0])) { ?>
      <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
   <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
$values = get_post_custom_values("Image"); echo $values[0]; ?>&w=100&h=65&zc=1&q=100"
alt="<?php the_title(); ?>" class="left" width="100px" height="65px"  /></a>
      <?php } ?>
   <div class="info"><a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php the_title(); ?></a>
<div class="meta">[<?php the_time('j M Y') ?> | <?php comments_popup_link('No Comment', 'One Comment', '% Comments');?> | <?php if(function_exists('the_views')) { the_views(); } ?>]</div>   

</div>
       </div>

      <?php endwhile; ?>

<!-- end of new code to show one more 'title image' and two posts of another category -->

   </div>

</div>   

   <div id="middle" class="clearfloat">

Now look at your page, you should see two posts of Featured category followed by the Spotlight image followed by two posts of your Gallery category.

Somewhere in this new code you find

showposts=2&category_name=Gallery

you can change Gallery to any other of your categories name.
Hope it works, exciting.. ;-)
____________________
you find me on Google+, Twitter and Facebook

(von: Joern)

Hier noch 8 weitere Ergebnisse dieses Threads:

Adding an extra heading to the Featured section

26. Mrz. 2010 (von: sharonp)

Hi Joern,In a previous forum I had requested some help regarding adding an extra heading in the Featured section for the Arthemia free template. I would like it to look like the following:FeaturedPost...(with photo thumbnail)Post...(with photo thumbnail)SpotlightPost...(with photo thumbnail)Post...(with photo…

Re: Adding an extra heading to the Featured section :: Reply by Joern

26. Mrz. 2010 (von: Joern)

hi Sharon, thanks for asking here..what I explained you in the Arthemia forum was just how to change the Image (Featured)But I guessed you would like to show under this featured title some posts of your featured category and following…

Re: Adding an extra heading to the Featured section :: Reply by sharonp

27. Mrz. 2010 (von: sharonp)

Hi Joern,Yes, your sample is EXACTLY what I'm looking to do. I would like the "Spotlight" heading to be the exact same font as the "Featured" font, just like you have in your sample. If you can give me the…

Re: Adding an extra heading to the Featured section :: Reply by sharonp

29. Mrz. 2010 (von: sharonp)

Thanks Joern. I'll give it a shot. Hopefully I won't mess things up Weiterlesen →

Re: Adding an extra heading to the Featured section :: Reply by sharonp

31. Mrz. 2010 (von: sharonp)

Hi Joern,Thanks! Your code worked perfectly You can see it here http://sharonpicone.com/ Weiterlesen →

Re: Adding an extra heading to the Featured section :: Reply by Joern

31. Mrz. 2010 (von: Joern)

Fine, your spotlight image is even better than mine ..What I recognize on your site is that you use quite big images in your footer, forcing them to display in smaller size. For performance reason it would be better to…

Re: Adding an extra heading to the Featured section :: Reply by sharonp

7. Apr. 2010 (von: sharonp)

Thank you Joern! I have another question. The code you gave me for the Spotlight header works perfectly in Firefox and Safari, but when I test it in IE, the Featured and Spotlight posts now scrunch on top of each…

Re: Adding an extra heading to the Featured section :: Reply by Joern

7. Apr. 2010 (von: Joern)

Sharon, I see you got it working with tables now.I can't see any problem on my test site with the old code still in place. But I am using IE8. With Safari I and can choose IE6 or IE7 as…

Autor:

Du findest mich auch auf Google+, Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.


weitere forum Beiträge: