go41

Video in Headline – separate custom field

von Joern am 11. Apr. 2009 | Keine Kommentare

Question: Adding video to the Headline section in Arthemia. I want to retain the current functionality for the headline category whereby a post is shown on the main page with the thumbnail and text. However, I also want to create a new category called "Video" which if selected, will allow me to populate a single video from Vimeo into the headline section.
Answer: It is easier to use an other custom field called ‚Video‘ where you insert the full embed code of the video. In the query for Headline posts we ask first if there is a custom field ‚Video‘. If this custom field is assigned to a post from category Headline, echo out the video code. If there is no custom field video, use ‚else‘ and display the image and excerpt as ususal.
I give you here a part of the code of index.php of Arthemia free version, modified to display a video if you assign custom field name: Video and a Value with the full code as you get from Vimeo or Youtube to embed a clip on your site:
<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(); ?>
<!– first new part, check for customfield Video –>
<?php $videovalues = get_post_custom_values("Video"); if (isset($videovalues[0])) { ?>
<div id="headlinevideo">
<?php echo $videovalues[0]; ?>
</div>
<?php } else { ?>
<!– end first new part –>
<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>
<!– second new part, end else do normal stuff –>
<?php } // end if video or else normal ?>
<!– end second new part –>
<?php endwhile; ?>
</div>
<div id="featured">
Actually I inserted two pieces here, first above <div class="title"> and second just before the <?php endwhile; ?> of Headline part.

The Video code is in a new div id="headlinevideo" so you can style it as you like, ie put in style.css this:

#headlinevideo {
margin:5px;
text-align:center;
}
this should center the video and give some space around.
Happy coding, you are welcome to ask here if you get problems
____________________
you find me on Google+, Twitter and Facebook

(von: master)

Hier noch 34 weitere Ergebnisse dieses Threads:

Re: Video in Headline – separate custom field :: Reply by Joern

5. Jan. 2010 (von: Joern)

Can I play a wmv file in this customfield?first: I wouldn't play a 'microsoft only' wmv file. If you use Windows Media format, you leave out your Mac visitors. If you use QuickTime (.mov), you leave out your Windows visitors.So…

Re: Video in Headline – separate custom field :: Reply by omarkhan

6. Jan. 2010 (von: omarkhan)

Joern, please answer me this then.,1. When you add an WMV file in your Headline post of arthemia, as I have done, the navbar appears behind it. I don't think the "wmode=transparent/opaque" works with non flash based movies. Is that…

Re: Video in Headline – separate custom field :: Reply by omarkhan

6. Jan. 2010 (von: omarkhan)

Its okay I fixed the problem. Used a wonderful player called flowplayer. Omar Weiterlesen →

Lost my featured categories on the front page

9. Aug. 2010 (von: Hanscrafter)

I've heavily modified the code of Arthemia for my website. As you can see, the Featured catergory has been moved. My boss doesn't want a generic "Featured" category but instead for each section to link to a different category. I…

adding first image from post to front page spoiler

12. Aug. 2010 (von: msderky)

hi so i have done some modification to my index.php. on the frontpage the code i am using is the index.php from your website, where you select one post from each category to be displayed on the frontpage. what i…

Arthemia category drop down

13. Aug. 2010 (von: shortybookit)

I have the free version and would like to add code that would allow the sub category's to drop down when a user is hovering mouse over one of the 5 category's on the main page. Thanks Weiterlesen →

Navbar a active color of text need some simple help pls!

14. Aug. 2010 (von: omerkhan02)

Hi Joern, You can visit my site here just want to know how you change the Navbar a active color of text.As you can see in the native statethe navbar is white and the text has the hexidecimal code #CC0000when…

style not showing up correctly in IE 8

17. Aug. 2010 (von: shortybookit)

I am using the newest version of Arthemia and WP but the text on the sidebar and left,right,middle footer is huge with in IE8 firefox shows up fine. domain in question thuylehomes.comthanksericI also have this theme on multiple other blogs…

Re: Lost my featured categories on the front page :: Reply by Joern

18. Aug. 2010 (von: Joern)

I was in Italy for holiday, did you manage it already?I see in the section you talk about (featured news..?) three images linking to a post and below titles linking to categories.You want links to categories as it is?And images…

Re: adding first image from post to front page spoiler :: Reply by Joern

18. Aug. 2010 (von: Joern)

actually this code inside the else statement looks well, if there is showing even an image it's good.It should show the first image of the post you just display, to debug I sometimes just echo the values I set to…

Re: Navbar a active color of text need some simple help pls! :: Reply by Joern

18. Aug. 2010 (von: Joern)

you are quite in the right place in style.css but you use font-color instead of the correct 'color'start here:#page-bar a:hover { text-decoration:none; display:block;font-color:#000000; }and change to:#page-bar a:hover { text-decoration:none; display:b... Weiterlesen →

Re: Navbar a active color of text need some simple help pls! :: Reply by Joern

18. Aug. 2010 (von: Joern)

The gap between the navbar and the header banner: remove '15px' in margin here:#navbar {background:url("images/navbar.png") repeat scroll 0 0 #2C2C2C;font:100% Arial,Helvetica;margin:auto 0;padding:0 10px;text-transform:uppercase;}____________________you find me on Google+, Twitter and Facebook Weiterlesen →

Re: style not showing up correctly in IE 8 :: Reply by Joern

18. Aug. 2010 (von: Joern)

in my IE8 it looks almost like in firefox??____________________you find me on Google+, Twitter and Facebook Weiterlesen →

Re: Lost my featured categories on the front page :: Reply by Hanscrafter

20. Aug. 2010 (von: Hanscrafter)

Dear Joern, The website just went live a little bit ago. I can't express my appreciation enough for how much help you've been. Thank you! Weiterlesen →

does a class within a div have its own properties. Here is an example

21. Aug. 2010 (von: omerkhan02)

In the featured section of my Arthemia, anytime an image is made into a link a border of 1px is put around it.I have added some social icons as you can seeFB, Twitter and Youtube within the featured divand when…

Re: does a class within a div have its own properties. Here is an example :: Reply by master

21. Aug. 2010 (von: master)

You can put a div class around all your social icons.just under<div id="featured" align="left">put<div class="socialicons">and the closing /div before your h3 Featured items!now restore the border in style.css under#headline a img, #featured a img {border:1px solid #CCCCCC;......and add an entry…

Re: adding first image from post to front page spoiler :: Reply by msderky

28. Aug. 2010 (von: msderky)

hmm i reset the query but that didnt make a difference. when i echo the value of the id it was correct id with the post but when i echo the image_src it was not the right one for the…

Re: adding first image from post to front page spoiler :: Reply by Joern

28. Aug. 2010 (von: Joern)

looking at the code again I think you get the matches after preg_match so you could try this by putting "$image_src = ..." below preg_match_allThe line with the comment ($image_src = '';) might help, try without this line first....$the_content =…

Thumbnail and nav bar colour in Arthemia

5. Sep. 2010 (von: ade)

Hi,First of all, I'd like to say thanks for this forum, having no clue about html it helped me customize Arthemia a little bit. However, I'm still struggling with a couple of things.The main one being that I can't get…

Re: Thumbnail and nav bar colour in Arthemia :: Reply by f-t-cat

5. Sep. 2010 (von: f-t-cat)

about the imagethe path you entered in the custom field looks correctly and the image is there. So the problem seems to be with the timthumb script.the folder where timthumb.php is in (/scripts) should have the folder permission 755 and…

Re: Thumbnail and nav bar colour in Arthemia :: Reply by ade

5. Sep. 2010 (von: ade)

Thanks a lot! Nav bar and comments sorted! For the thumbnails it doesn't seem to work. I've changed the folder/timthumb permission in ftp but no changes.I also tried to modify those lines with every combinations but no changes; maybe i…

Re: Thumbnail and nav bar colour in Arthemia :: Reply by f-t-cat

5. Sep. 2010 (von: f-t-cat)

I just see you use a .png file as image, I would try with .jpg.-and the file ...wp-content/uploads/2010/09/Ozgeneral.png is even not there anymore (It was there before..)as the timthumb script is still developed you could try the latest version you…

Re: Thumbnail and nav bar colour in Arthemia :: Reply by ade

5. Sep. 2010 (von: ade)

Thanks a lot! The new timthumb scripts did the trick!As for SEO about pages and posts, I guess I'll just have to do some more reading!Thanks! Weiterlesen →

Re: Thumbnail and nav bar colour in Arthemia :: Reply by master

5. Sep. 2010 (von: master)

If you like the design of arthemia you might find some good modifications of this theme here:http://themes.go41.de/downloads/there is a theme-switcher on top of every page to see different themes with the same content.____________________you find me on... Weiterlesen →

Re: Thumbnail and nav bar colour in Arthemia :: Reply by ade

6. Sep. 2010 (von: ade)

Nice! I'll definitely use the sliding headline for another website! But that raises another question. How to get the logo extended like this http://themes.go41.de/?wptheme=aranovo2 ; when i try, it just pushes the advertising further down. Weiterlesen →

Autor:

Du findest mich auch auf Google+, Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.


weitere forum Beiträge: