msgbartop
and his Coffee-Break Brain-Dump
msgbarbottom

06 May 09 corporatemag Theme code fix

For those still having some difficulty with the Corporatemag theme, namely getting links to work on an archive/category list. Try this:

Go to the Theme editor and select the archive.php file. Replace the content with the code in red below:

<?php get_header(); ?>

<div id=”content”>
<?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h2 class=”pagetitle”>Archive for the ‘<?php single_cat_title(); ?>’ Category</h2>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h2 class=”pagetitle”>Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2 class=”pagetitle”>Archive for <?php the_time(‘F jS, Y’); ?></h2>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2 class=”pagetitle”>Archive for <?php the_time(‘F, Y’); ?></h2>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2 class=”pagetitle”>Archive for <?php the_time(‘Y’); ?></h2>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2 class=”pagetitle”>Author Archive</h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2 class=”pagetitle”>Blog Archives</h2>
<?php } ?>
<?php while(have_posts()) : the_post(); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<h3 class=”title”><a href=”<?php the_permalink() ?>” ><?php the_title(); ?></a></h3>
<div class=”entry”>
<?php the_excerpt(); ?>
</div>
</div>
<?php
endwhile;
$nextPost = get_next_posts_link(‘Next’);
$prevPost = get_previous_posts_link(‘Previous’);
?>
<div id=”post-nav”>
<?php if($nextPost): ?>
<div id=”nav-next-post”><?php echo $nextPost ?></div>
<?php endif ?>
<?php if($prevPost): ?>
<div id=”nav-prev-post”><?php echo $prevPost ?></div>
<?php endif ?>
<div class=”clear”></div>
</div><!– /post-nav –>
<?php else: ?>
<h2 class=”center”>Not Found</h2>
<p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
<?php endif ?>
<?php get_sidebar(); get_footer(); ?>

Then go to the Theme editor and select the search.php file. Replace the content with the code in green below:

<?php get_header(); ?>

<div id=”content”>
<?php if (have_posts()) : ?>
<h2 class=”pagetitle”>Search Results</h2>
<?php while(have_posts()) : the_post(); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<h3 class=”title”><a href=”<?php the_permalink() ?>” ><?php the_title(); ?></a></h3>
<div class=”entry”>
<?php the_excerpt(); ?>
</div>
</div>
<?php
endwhile;
$nextPost = get_next_posts_link(‘Next’);
$prevPost = get_previous_posts_link(‘Previous’);
?>
<div id=”post-nav”>
<?php if($nextPost): ?>
<div id=”nav-next-post”><?php echo $nextPost ?></div>
<?php endif ?>
<?php if($prevPost): ?>
<div id=”nav-prev-post”><?php echo $prevPost ?></div>
<?php endif ?>
<div class=”clear”></div>
</div><!– /post-nav –>
<?php else: ?>
<h2 class=”center”>Not Found</h2>
<p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
<?php endif ?>
<?php get_sidebar(); get_footer(); ?>

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • TwitThis

Reader's Comments

  1. |

    still having the same problem…

  2. |

    Sorry Jerimee. It’s not my theme, I just decided to use it for a while and all I can say is the fix above worked for me.

    It was few weeks ago when I picked my way through this, but as I remember it was just a couple of lines of code in the middle of this lot, referencing the permalink. It just seemed easier to paste the the code in full rather than try to explain which bit of code on which precise lines needed changing. It is pretty basic stuff however, nothing clever at all and I am confident that the fix should work.

    I assume you have tried emptying the cache and refreshing the page.

    Also I did not do any browser testing on this. I use Firefox and Safari and all is working well in these browsers. However, while the fix should work irrespective of browser, I am often astounded at the capacity that Internet Explorer has for sabotaging webpages, particularly Internet Exploder 6 – you can never discount that entirely! :)

  3. |

    Hi. Any idea how to get this theme to accept an custom homepage?
    The included theme toolkit is always calling the index.php Or an another way how to call in the back end categories for the featured content slider?
    The problem is, to be able to call my custom homepage I have to shut down the theme toolkit in the functions.php, but by doing that I also shut down the pooling of posts for the carousel.
    Thank you for any tips. I am struggling here for weeks now.

  4. |

    It sounds like you have looked at some of the obvious things and I would probably start with the WordPress forums – http://wordpress.org/tags/custom-home-page seems a likely place to start.

    I am not totally convinced by this theme. The fact that I and others have had to fix fairly standard things in it, suggests that it was not well tested in the first place. I suspect it may be buggy in other places because of this. For this reason, I won’t be sticking with it and I will ditch it in favour of something else in due course. All of which means I am not going to spend any more time patching it up.

    Sorry, that this is not too helpful, I think you need to get onto the guy who designed it in the first place. The link at the foot of the page says it is Web Hosting Fan http://www.webhostingfan.com/, but there is nothing on their website about it. I think http://www.veskoto.co.cc/ may be more use.

    DY

  5. |

    Hi Dave,

    Thanks for your fix job, It really helps me a lot, I like this theme very much but still have some issues, could you share me your theme pack (already modify successed) as well? and which version of wordpress are you using now?

    Thanks a lot
    CM

  6. |

    Just curious about which version of Wordpress are you using now? I have another issue – I can’t seem to get the comment template to appear even though my posts have comments enabled. Wondering if it is an issue of Wordpress 2.8…

    Keith

  7. |

    Ok, please ignore + delete this and my previous comment. I got it fixed – I removed the default theme from wordpress, that’s why the comments template ain’t showing up. =)

  8. |

    Having solved some of the various corporatemag wordpress theme problems and made these available to others, I have found myself running a sort of clinic on the side to help others fix their technical issues with it. But no more! I did not design the theme and so I cannot really take responsibility for it.

    I guess I am fed up with it. For all its elegance, cleverness and subtlety, it is a very buggy theme and looking a little dated these days. I will leave my code, above, for you to use as you want, but forgive me if I don’t support it any more.

    I have moved on and am carving my web presence up – I will keep separate WordPress sites for blogging; portfolio; business and so on. I will be developing co-ordinating themes to manage these and if they are any good I will put them out there.

    In the meantime, I have installed the beautifully pared down Google Chrome Theme from Smashing Wordpress Themes

Leave a Comment