mardi 4 octobre 2016

Code PHP in Wordpress Custom Post Type

I’m new to PHP and am looking for someone to help with a Wordpress Post type I created with AFC

Below is the code that returns the following page: http://ift.tt/2dATDBX
I would like it to look like this: http://boondocks.bar

Any help would be much appreciated. Thanks

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

<div class="flyer-images">            

<?php if(is_category( 'Featured' )) ?>

   <div class="main-image">

<img class="top-tape" src="/wp-content/uploads/2016/01/tape-top.png" />


    <div class="pic1 event-hover">

<?php 
$image = get_field('mainpic1'); 
$size = "full"; // (thumbnail, medium, large, full or custom size)
?>
<a href='<?php echo $image['url']; ?>' rel="lightbox" title="&lt;a target='_blank' onClick=&quot;window.location.href=&quot;url&quot;   href='<?php the_field('featured_image_url'); ?>'&gt;<h30>EVENT INFO</h30>&lt;/a&gt;"><img src="<?php echo $image['sizes']['medium']; ?>" alt="<?php echo $image['alt']; ?>" /></a>
    </div>

   <div><img class="bottom-tape" src="/wp-content/uploads/2016/01/tape-btm.png" />
   </div>

  </div>

<div class="events-p1">
<div class="flyer-images-row">
<div class="flyer-col">

<?php if(is_category( 'Uncategorized' )) ?>
<?php if( have_rows('images1') ): ?>

    <?php while( have_rows('images1') ): the_row(); 

        // vars
        $image = get_sub_field('pic1');
        $link = get_sub_field('website1');

        ?>
<div class="flyer-pic event-hover">

            <?php if( $link ): ?>
                <a href='<?php echo $image['url']; ?>' rel="lightbox" title="&lt;a target='_blank' onClick=&quot;window.location.href=&quot;url&quot;  href='<?php the_sub_field('website'); ?>'&gt;<h30>EVENT INFO</h30>&lt;/a&gt;">
            <?php endif; ?>

                <img src="<?php echo $image['sizes']['medium']; ?>" alt="<?php echo $image['alt']; ?>" /></a>
    </div>

<?php endwhile; ?>

<?php endif; ?>

</div>
</div>
</div>

<?php endwhile; // end of the loop. ?>

Aucun commentaire:

Enregistrer un commentaire