• Resolved ifcure08

    (@ifcure08)


    Hi,

    I have a piece of CODE outside the LOOP, that I am trying to figure out how to modify so it will ADD a ICON of a PLAY button on the THUMB (PNG) if it is from the VIDEO CATEGORY.

    <div id="video-grid">
        <?php
    $args = array( 'numberposts' => 12 );
    $lastposts = get_posts( $args );
    foreach($lastposts as $post) : setup_postdata($post); ?>
        <div class="story">
        <a>"><?php the_post_thumbnail('thumbnail', array('class' => 'grid-thumb')); ?></a>
    <a>"><h2><?php the_title(); ?></h2></a>
          <p><a>"><?php echo excerpt(12); ?> Read More</a></p>
        </div>
        <?php endforeach; ?>
      <div class="clearer"></div>
    </div>
Viewing 15 replies - 1 through 15 (of 20 total)
  • The code posted above seems to be malformed.

    Thread Starter ifcure08

    (@ifcure08)

    Wow that was helpful lol

    Thread Starter ifcure08

    (@ifcure08)

    I do not know why it pasted that way ??

    <div id="video-grid">
        <?php
    $args = array( 'numberposts' => 12 );
    $lastposts = get_posts( $args );
    foreach($lastposts as $post) : setup_postdata($post); ?>
        <div class="story">
        <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail', array('class' => 'grid-thumb')); ?></a>
    <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
          <p><a href="<?php the_permalink(); ?>"><?php echo excerpt(12); ?> Read More</a></p>
        </div>
        <?php endforeach; ?>
      <div class="clearer"></div>
    </div>

    well, there’s not a lot we can do with malformed code. Lines like:

    <a>"><?php the_post_thumbnail('thumbnail', array('class' => 'grid-thumb')); ?></a>
    <a>"><h2><?php the_title(); ?></h2></a>

    make absolutely no sense and suggest that you posted the code initially without using the code button on this forum. Try posting it again – in a code block this time…

    Where is the line of code for adding in the icon?

    Thread Starter ifcure08

    (@ifcure08)

    Hi,

    Sorry I was away, I am attempting to do this outside the LOOP and it was hard to find good info on it, I am pulling 12 recent stories, with THUMB, excerpt (12 words) Link, on my homepage – I am looking to add in code that can also allow me to plop a PNG on top of thumbnails from a certain category – like watermark.. Lots of fun ??

    HERE IS THE CODE WITHOUT THE CODE PASTE

    <div id=”video-grid”>
    <?php
    $args = array( ‘numberposts’ => 12 );
    $lastposts = get_posts( $args );
    foreach($lastposts as $post) : setup_postdata($post); ?>

    <div class=”story”>
    “><?php the_post_thumbnail(‘thumbnail’, array(‘class’ => ‘grid-thumb’)); ?>
    “><h2><?php the_title(); ?></h2>
    <p>“><?php echo excerpt(12); ?> Read More</p>
    </div>

    <?php endforeach; ?>

    <div class=”clearer”></div>
    </div>

    Thread Starter ifcure08

    (@ifcure08)

    Paste is still looks all wrong, there is a paste above that looks right though – I am asking how to add in a code that adds the watermark. Sorry for the extra posts.

    Can you try adding the code block between backticks, use the code button or try using a pastebin?

    Thread Starter ifcure08

    (@ifcure08)

    Thread Starter ifcure08

    (@ifcure08)

    The best way I have come to is to have a conditional tag on the THUMB class – if it is category A use THUMB class A, if it is all other categories use class B – I do not know how to modify this to do that out the loop.

    Hope that helps and much appreciated !

    Thread Starter ifcure08

    (@ifcure08)

    Anyone know how to add in a conditional tag for the thumbnail class?

    Thread Starter ifcure08

    (@ifcure08)

    Why does my thread say RESOLVED? Lol

    It doesn’t. Try https://pastebin.com/3XLQLRwJ

    Thread Starter ifcure08

    (@ifcure08)

    Hey – that really did the track for the CLASS on the THUMB – but I cannot layer a img on an img using CSS – maybe it would be best if it left the img class and changed the STORY DIV? I do not know how to get the PNG of a video icon to layer ONTOP of the THUMB. Any ideas?

    thanks for help

    Sorry – not sure I follow you…

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Adding a WATERMARK to a thumbnails if in a specific category’ is closed to new replies.