Need help with some code
Currently the left column supports three snippets, with the ability to add images above each snippet. What I'm trying to do is place an adblock between either the first and second, or the second and third snippet or image.
I'm told that I'd probably need to call the loop twice. One with only one post followed by the ad space and the second displaying two posts. I'm sure it is great information only thing is I'm php illiterate!
So anyone here using the BrandfordMagazine Theme and achieved a similar result? Would love to see the code Or anyone like to take a bash at showing me how its done. A big ask I know but I'll keep my fingers are crossed.
Kevin
here's the appropiate bit of code from index.php
<?php get_header(); ?> <div id="content"> <?php // Include tabs with the lead story include(TEMPLATEPATH . '/ui.tabs.php'); ?> <div id="leftcol"> <?php // "Featured articles" module begins query_posts('showposts=3&cat=4'); ?> <h3> <?php // name of the "featured articles" category gets printed wp_list_categories('include=4&title_li=&style=none'); ?> </h3> <?php while (have_posts()) : the_post(); ?> <div class="feature"> <?php // this grabs the image filename $values = get_post_custom_values("featuredarticleimage"); // this checks to see if an image file exists if (isset($values[0])) { ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('url'); echo '/'; echo get_option('upload_path'); echo '/'; // this is where the custom field prints images for each Feature $values = get_post_custom_values("featuredarticleimage"); echo $values[0]; ?>" alt="featuredimage" /></a> <?php } ?> <a href="<?php the_permalink() ?>" rel="bookmark" class="title"> <?php // title of the "featured articles" the_title(); ?> </a> <p> <?php the_content_rss('', TRUE, '', 20); ?> </p> </div> <?php endwhile; ?> </div> <!--END LEFTCOL-->
-
TheFacelessGuru -
Thanks
SignatureWATCH FREE MARKETING VIDEOS ON MY YOUTUBE CHANNEL. Affiliates Welcome{{ DiscussionBoard.errors[395096].message }} -