sorry, I missed the link around the image. this link brings you to the post if you click on the image. (I did not try this code..)
I guess the video should not be linked, so I change the code above again to leave the link only around the image if there is no video:
<div id="headline">
<img src="<?php echo get_option(‚home‘); ?>/wp-content/themes/arthemia/images/headline.png" width="75px" height="21px" alt="" />
<?php query_posts("showposts=1&category_name=Headline"); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></div>
<div class="meta">[<?php the_time(‚j M Y‘) ?> | <?php comments_popup_link(‚No Comment‘, ‚One Comment‘, ‚% Comments‘);?> | <?php if(function_exists(‚the_views‘)) { the_views(); } ?>]</div>
<?php $videovalues = get_post_custom_values("Video"); if (isset($videovalues[0])) { // checks for video ?>
<div id="headlinevideo">
<?php echo $videovalues[0]; ?>
</div>
<?php } else { // shows image if no video is set ?>
<?php $values = get_post_custom_values("Headline");?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<img src="<?php echo bloginfo(‚template_url‘); ?>/scripts/timthumb.php?src=/<?php
$values = get_post_custom_values("Image"); echo $values[0]; ?>&w=300&h=275&zc=1&q=100"
alt="<?php the_title(); ?>" class="left" width="300px" height="275px" /></a>
<?php } // end if have video or else image ?>
<?php the_excerpt(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read the full story »</a>
<?php endwhile; ?>
</div>
That was easy, just moved two lines ‚<?php $values = ge..‘ and ‚<a hre…‘ down into the else part.
Now about the excerpt being pushed down. If you have no video but an image, this image is set to float: left; by the img class left.
As I put a div headlinevideo around the video you should set this also to float left:
#headlinevideo {
margin:5px;
text-align:center;
float:left;
}
I do not know your video size and if there is enough space for text beside, but now the excerpt should align on the right beside the video floating left
____________________
you find me on Google+, Twitter and Facebook
(von: Joern)
Hier noch 7 weitere Ergebnisse dieses Threads:
Substitute Headline Section Image with Video
18. Dez. 2010 (von: raf_79)
Hello,I came across this topic in your forum "Video in Headline - separate custom field" at:viewtopic.php?f=1&t=17It tells how to put a video in the 'Headline' section - which is nice but that is all that's left there in that big…
Re: Substitute Headline Section Image with Video :: Reply by raf_79
21. Dez. 2010 (von: raf_79)
Hello. I hope you are well.Is there no answer to whether only the picture in the Arthemia 'Headline' section can be changed to video while leaving the title, meta, excerpt, etc in place? Thank you in advance for your answer.…
Re: Substitute Headline Section Image with Video :: Reply by Joern
22. Dez. 2010 (von: Joern)
in the post you refer to there is also written how to get the_excerpt and the_title displayed (second post in that thread)here is how arthemia free version headline section looks like (unchanged):<div id="headline"> <img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/headline.png" width="75px" height="21px"…
Re: Substitute Headline Section Image with Video :: Reply by raf_79
22. Dez. 2010 (von: raf_79)
Thanks Joern for your response. Glad you are well! The above coding does work, however the excerpt text is now pushed down below the video as if something invisible is filling the space where it would otherwise be. When I…
Re: Substitute Headline Section Image with Video :: Reply by raf_79
23. Dez. 2010 (von: raf_79)
Thank you! Thank you! Thank you! It all seems to be working great now! Just had to tweak the css styling a little to add spacing to keep the text from butting up to the video player. (the video is…
Re: Substitute Headline Section Image with Video :: Reply by Joern
23. Dez. 2010 (von: Joern)
great! about the length of the excerpt:There are quite a few ways to set the length of the_excerpt by coding something in your theme files (see: viewtopic.php?f=1&t=6 )Most easy is in your post editor, there is a field for a…
Re: Substitute Headline Section Image with Video :: Reply by raf_79
23. Dez. 2010 (von: raf_79)
Thanks for the response. I did use the post-excerpt section as that seemed to be the quickest/easiest solution. I also removed the headline more-tag for my needs. Thank you again for your help. Weiterlesen →