Hi guy's
I have wordpress article directory them and i have in my categories pages
empty place from the right of the child categories you can take a look at
http://www.magazinearticle.net/category/business
I want to put in this space a adsense ads
what i need to chenge in the code to show the ad in this empty place ?
Here the code:
<?php get_header(); ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php if (is_category()) { ?>
<h2 class="pagetitle">Archive for the "<?php echo single_cat_title(); ?>" Category</h2>
<?php } ?>
<div class="nav">
<a href="<?php bloginfo('url'); ?>/">Home</a> » <?php echo(get_category_parents($cat, TRUE, ' » ')); ?>
</div>
<?php if (get_categories('child_of='.$cat.'&hide_empty=0')) { ?>
<h3>Subcategories:</h3>
<ul class="child-categories">
<?php wp_list_categories('show_count=1&child_of='.$cat.'&hide_empty=0&title_li='); ?>
</ul>
<?php } else { ?>
<?php
$ID = $wp_query->posts[0]->ID;
$postcat = get_the_category($ID);
$cat = $postcat[0]->cat_ID;
$parent = get_category($cat);
?>
<?php if ($parent->parent) { ?>
<h3>Other Subcategories of the "<?php $parentCat = get_category($parent->parent); echo $parentCat->cat_name; ?>" Category:</h3>
<ul class="child-categories">
<?php error_reporting(0); wp_list_categories ('show_count=1&child_of='.$parent->parent.'&exclude='.$cat.'&hide_empty=0&title_li='); ?>
</ul>
<?php } else {
echo '<h3>No articles in this category.</h3>';
} ?>
<?php } ?>
<?php
$order = "&orderby=cost&order=DESC";
$s2 = ' selected="selected"';
if ($_POST['select'] == 'title') { $order = "&orderby=title&order=ASC"; $s1 = ' selected="selected"'; $s2 = ''; }
if ($_POST['select'] == 'newest') { $order = "&orderby=cost&order=DESC"; $s2 = ' selected="selected"'; }
if ($_POST['select'] == 'oldest') { $order = "&orderby=cost&order=ASC"; $s3 = ' selected="selected"'; $s2 = ''; }
?>
<form method="post" id="order">
Sort by:
<select name="select" onchange='this.form.submit()'>
<option value="title"<?=$s1?>>Title</option>
<option value="newest"<?=$s2?>>Newest</option>
<option value="oldest"<?=$s3?>>Oldest</option>
</select>
</form>
<div class="line"></div>
<?php if (have_posts()) : ?>
<?php $posts = query_posts($query_string . $order); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<div class="postmetadata"><?php the_time('m.d.Y') ?> | Author: <a href="<?php bloginfo('url'); ?>/author/<?php the_author_login(); ?>/"><?php the_author() ?></a> | Posted in <?php the_category(', ') ?> | <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></div>
<div class="entry">
<?php the_excerpt(); ?>
</div>
</div>
<?php endwhile; ?>
<div class="navigation"><?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?></div>
<?php else : endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Thanks a million
Php help needed
Moderator: General Moderators