Need help with some code

by kah22
1 replies
  • WEB DESIGN
  • |
I'm currently working with The BranfordMagazine WP Theme - here's my URL - Dogs Worldwide; but it is a work in progress and hid from the search engines for now, so if it looks wobble it's just that I'm experimenting.

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

Code:
<?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-->
#code
  • Profile picture of the author TheFacelessGuru
    I've never worked with PHP before, but HTML I have, which is simular I think. I think all you have to do is ad a table in between and insert the add inside the table. Then just change the table properties of the borders to white to match the white color of your background. This way the table will be invisiable to everyone else.

    Hope this might help you .

    The Faceless Guru
    {{ DiscussionBoard.errors[395096].message }}

Trending Topics