go41

Re: Substitute Headline Section Image with Video :: Reply by Joern

von Joern am 22. Dez. 2010 | Keine Kommentare

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" 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 $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 the_excerpt(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read the full story &raquo;</a>
<?php endwhile; ?>
</div>
we can leave all as it is and only add the part for the video clip just before the image. If there is no video set it will dsplay the image. Looking now like this:
<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 $values = get_post_custom_values("Headline");?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">

<?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 ?>

<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 &raquo;</a>
<?php endwhile; ?>
</div>
this will show the post as you set it. The video will replace the image if you set one.
It might be not enough space to show a video plus this big image..
Can you get it? Sorry for late reply…
____________________
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 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 Joern

22. Dez. 2010 (von: Joern)

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…

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 →

Autor:

Du findest mich auch auf Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.


Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.

weitere forum Beiträge: