go41

latest post as headline, followed by featured and subsequent below

von Joern am 26. Aug. 2009 | Keine Kommentare

Modify the front page view of arthemia to show most recent (newest) post as ‚headline‘, next four older posts as ‚featured‘ and the subsequent posts continuing below.
Arthemia normally shows in the Headline section posts assigned to the category Headlines. Featured section shows posts from the category featured. All other posts follow below. So older posts of of the two sections above will disappear as soon there is a new entry.
I modified the index.php of arthemia free version to show your last post in Headline section, the next for older posts are shown in Featured section and even older posts follow below and on subsequent pages.
As with this mod you show 10 posts on the frontpage, you should set the Reading Settings in your WordPress dashboard to "Blog pages show at most 10 posts"

With this setting pagination is working as it should.
The only modifications in the following code are in lines:

10-12, 23, 30, 76-82
index.php code for normal flow of posts regardless any category:
Code:

<?php get_header(); ?>

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

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

      <div id="headline">
      <img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/headline.png" width="75px" height="21px" alt="" />

      <?php $lastposts = get_posts('numberposts=1');  //modified
 foreach($lastposts as $post) :  //modified
 setup_postdata($post); $do_not_duplicate = $post->ID;  //modified ?>

   <div class="title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></div>
   <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>
   <?php $values = get_post_custom_values("Headline");?>
    <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=300&h=275&zc=1&q=100"
alt="<?php the_title(); ?>" class="left" width="300px" height="275px"  /></a>
   <?php the_excerpt(); ?>
   <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read the full story &raquo;</a>
<?php endforeach; //modified ?>
   </div>

   <div id="featured">

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

<?php query_posts("showposts=4&offset=1"); $i = 1;  //modified ?>

         <?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; ?>

   </div>

</div>   

   <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(5,6,7,8,11); $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>

   <?php } ?>

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

   <div id="front-list">   

<?php
  $page = (get_query_var('paged')) ? get_query_var('paged') : 1;  // checks the page you are on
  $num_of_posts = get_option('posts_per_page');  // gets settings of posts per page in admin - Reading Settings, first page shows 10 posts, so set to 10 in admin - Reading Settings
   if ( !is_paged()){
   query_posts("paged=$page&offset=5&posts_per_page=5"); // if it is NOT paged show 5 posts with offset of 5 in headline and featured
 } else {
query_posts("paged=$page&posts_per_page=$num_of_posts"); } // if it is paged gets pagenumber and settings of posts per page in admin, 10 posts would be best  ?>

     <?php while (have_posts()) : the_post(); ?>      

   <div class="clearfloat">
   <h3 class=cat_title><?php the_category(', '); ?> &raquo;</h3>
   <div class="title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></div>
   <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 class="spoiler">
   <?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=150&h=150&zc=1&q=100"
alt="<?php the_title(); ?>" class="left" width="150px" height="150px"  /></a>
      <?php } ?>

   <?php the_excerpt(); ?>
   </div>

   </div>

      <?php endwhile; ?>

   <div class="navigation">
      <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
         else { ?>

         <div class="right"><?php next_posts_link('Next Page &raquo;') ?></div>
         <div class="left"><?php previous_posts_link('&laquo; Previous Page') ?></div>
         <?php } ?>

   </div>

   </div>

   <?php get_sidebar(); ?>

   </div>   

<?php get_footer(); ?>

____________________
you find me on Google+, Twitter and Facebook

(von: Joern)

Hier noch 18 weitere Ergebnisse dieses Threads:

Can admin please answer my questons. Been 2 weeks. Database Backup failed!

16. Aug. 2011 (von: omerkhan01)

I have downloaded plug in called security scan and when trying to backup my database it saysFatal error: Out of memory (allocated 63700992) (tried to allocate 42755596 bytes) in /home/content/m/a/a/maaxseduction/html/wp-content/plugins/wp-security-scan... Weiterlesen →

Website not working

18. Aug. 2011 (von: sim_a1)

Hi joern. Can you plz help me out with this issue. My website is working. Not a single post is getting displayed. You can check yourself at techaban. Could you please tell what could be the problem. Weiterlesen →

Re: Can admin please answer my questons. Been 2 weeks. Database Backup failed! :: Reply by master

26. Aug. 2011 (von: master)

sorry for late reply, made some holiday in Istanbul ..if that plugin called security scan needs more memory than your server (provider) allows you to use, there is not much to do.There are more other plugins you could try,I normally…

Arthemia, language problem

4. Sep. 2011 (von: Annie)

Hi Joern!I can see that you are a very helpfull guy. I bought Arthemia, by ColorLabs, unfurtunally I cant get in to their support site, so I wonderet if you could help me.1.The usual wordpress lauange transmitter dosn't work for…

Re: Arthemia, language problem :: Reply by Joern

4. Sep. 2011 (von: Joern)

hi Annie, that's quite some work, you have to edit the theme files in arthemia-premium folder.let's say you take index.php or header.php (headline/featured), you should find as example:<?php comments_popup_link('No Comment', 'One Comment', '% Comments');?>In german I would change to:<?php comments_popup_link('kein…

Re: Arthemia, language problem :: Reply by Annie

5. Sep. 2011 (von: Annie)

Hi Joern!Thank you so much I do have so many problems with ColorLabs and Arthemia thou, when I opend my page today, everythig was a complete mess, and I can't get in contact with them. Their webpage just sends me…

Re: Arthemia, language problem :: Reply by Annie

8. Sep. 2011 (von: Annie)

OK, the webpage went back to normal, I calmed down, and decited to continue with Arthemia But there is still no contact to the ColorLab support theme I have four questions more, and then Im done. (I hope Can you…

Re: Arthemia, language problem :: Reply by Annie

8. Sep. 2011 (von: Annie)

By the way, I have seen your guide to:Modify the front page view of arthemia to show most recent (newest) post as 'headline', next four older posts as 'featured' and the subsequent posts continuing below.I don´t want to change 'featured',…

Re: Arthemia, language problem :: Reply by Joern

9. Sep. 2011 (von: Joern)

to make it short (eg: I didn't test)to show your latest post in headline, no matter which category:in header.php is the query for headline posts, this query checks for the category you choose for headlines, should be now like this:<?php…

Re: Arthemia, language problem :: Reply by Annie

9. Sep. 2011 (von: Annie)

Hi Joern!Thank you!1. worked - its now the newest post, despite what category its in. But I would like to exclude the featured category. It must only be showed on featured, nowhere else.2. I have a One-column list, but the…

Re: Arthemia, language problem :: Reply by Joern

9. Sep. 2011 (von: Joern)

it's going to be complicated ..I just tried to 'read' index.php again and realized, that the first post here (your second oldest post) is formatted different, it shows: the_content ...the following posts show this post again, because there is an…

Re: Arthemia, language problem :: Reply by Annie

12. Sep. 2011 (von: Annie)

Hi Joern! Thank you!It was not so complicated, I just removed the whole list.Now there are just some cosmetic issues with my web-page, then I'm ready to go.Maybe you can help me there also?! Now that the headline category is…

Re: Arthemia, language problem :: Reply by Joern

13. Sep. 2011 (von: Joern)

Hi Annie, you are right, there is no category assigned to display.The line generating this text is in header.php, in my copy of this theme it looks like this:<div class="label"><a href="<?php echo get_category_link($ar_headline);?>"><?php single_cat_title(); ?> &raquo;</a></div>I can't open your site…

Re: Arthemia, language problem :: Reply by Annie

13. Sep. 2011 (von: Annie)

Hi Joern!It worked - again - like a charm!The dotted line reapered, but disapered in another place, when I made these changes.I probably will come back Thank you for all your help!!!Best regards Annie Weiterlesen →

Arthemia poll’s

13. Sep. 2011 (von: Annie)

Hi Jorn!You shouldn´t happen to know if any wordpress poll works with Arthemia?I tryed out A LOT of them, UPM Polls, Version 1.0.4, By ProfProjects ( Artyom Chakhoyan ) works best, but is not good enough, since the layout goes…

Re: Arthemia poll’s :: Reply by Joern

14. Sep. 2011 (von: Joern)

I just used a post-rating plugin (WP-PostRatings) a while ago, I got the feeling it blows up the database, made the site slow due to many queries and - these plugins do not bring you any more visitors.AJAX uses JavaScript…

Re: Arthemia poll’s :: Reply by Annie

22. Sep. 2011 (von: Annie)

I have desited to wait, maybe I´ll look at it later. Thanks Weiterlesen →

Re: Website not working :: Reply by suetom80

7. Nov. 2011 (von: suetom80)

i used to havre the same issuecan't remember what was wrong it was long time ago...maybe try to reinstall it hope i could help, sue-------------raminoroyalonline dot com 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: