Yesterday, I attended WordCamp Jerusalem 2010 and lectured about WordPress 3.
My presentation included some very handy code snippets, links and information so I decided to upload it to slideshare for anyone to catch up.
The video:
I used WordPress’ get_the_post_thumbnail() function in order to output the current post’s featured image. It was great, until I had to link to the featured image. To do that, I needed the value of the SRC attribute of that IMG tag, i.e., the direct link to the featured image.
Thanks to phpxref, and the WordPress Codex, I managed to write a small useful function just for that. Without further ado, I present to you, the function:
function oy_get_direct_thumbnail_link( $post_id = NULL ) { global $id; $post_id = ( NULL === $post_id ) ? $id : $post_id; $src = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'full'); $src = $src[0]; return $src; }
The first and only parameter ($post_id) is optional. If used inside the loop, it fetches the current post’s ID by itself.
Search terms:- get post featured image
- get featured image
- featured image link
- get featured image from post
- get_posts featured image
- post featured image
- get featured image post
- get featured image of post
- get_post featured image
- get_post_featured_image
If the question intrigues you, this video of me lecturing about it will probably answer it for you. This video was shot last month in a user-generated content meeting organized by StartupSeeds.
The lecture is in Hebrew but there are English subtitles available.
Search terms:- tamplate website of Leacture
- what is wordpress
First, thank you for the bug reports. Without them, new & enhanced versions simply won’t come out.
The plugin now has better video detection capabilities, and a serious bug regarding the auto thumbnailing feature is fixed.
You can download the new version at:
http://wordpress.org/extend/plugins/youtube-thumbnailer/
Any bug reports, feature requests or comments are welcomed in the comments section below.
Search terms:- josh is yom tov
- smart youtube widget html code
- recent posts you tube thumbnail widget
- resize youtube thumbnail
- smart youtube thumbnail problem
- widget that generates thumbnails from embeded video
- youtube embed set thumbnail
- youtube video embedded uncorrected show ie
- ytimg com get custom thumbnails
Have a look at your browser’s address bar – your sight is just fine. You actually are on orenyomtov.com as opposed to this morning, when this website lived under the .info TLD.
It has been quite a long time since I made the decision to move to the new domain. But there were two drawbacks which delayed the domain transfer. The first one is lack of time, and the second one is… Well, my laziness.
Anyways, I thought I would share some of the steps I took in order to move the website to the new domain. I was lucky enough that I didn’t have to change hosts. Doing that may have required some additional steps.
- I bought the new domain and linked it to my hosting.
- I downloaded the latest WordPress installation and uploaded it into the new domain by FTP (Looking for an FTP client?).
- I copied the
wp-contentfolder. And in my case, the “downloads” folder which is the folder I chose to store the uploads in (Default iswp-content/uploads). - I also copied the
wp-config.phpfile and the.htaccessfile. - I used the Search and Replace WordPress plugin to replace “orenyomtov.info” with “orenyomtov.com” in the database.
- I notified Google of the domain change in Google Webmaster Tools.
- I exported a new sitemap using the Google XML Sitemap Generator plugin and submitted it to Google Webmaster Tools.
- I opened a new Google Analytics account and deployed the new tracking code in the theme I copied in step 3.
- I edited the old .htaccess file to contain only:
RewriteEngine on
RewriteRule (.*) http://orenyomtov.com/$1 [R=301,L] - I updated my FeedBurner account and all other similar services.
- I updated my website to the new URL in all of my favorite social platforms (@orenyomtov) and forums.
- Twit twit.
- And then I began writing this post.
The move didn’t take as long as I expected it to take. Even though it does seem a little complicated after writing it all down.
I hope that your move will be as smooth as mine. Good luck, Oren.
Search terms:- com domain
- oren dot com
I’ve received many emails complaining that the plugin does not recognize YouTube videos. Because of lack of time, I delayed the update until now.
I just released an update to the plugin which should solve most of the issues that I was contacted about.
Go ahead and download the new version:
http://wordpress.org/extend/plugins/youtube-thumbnailer/
- can\t get youtube thumbnail plugin to work
- detect the thumbnail of a youtube video facebook wordpress
- wp plugin custom youtube thumbnail
- youtoube yom
- youtube custom field plugin
- youtube thumbnailer not working
- youtube thumbnailer what do i do with the custom name
- youtube thumbnails wp plugin
A theme consists of many files, this can get very confusing very fast. What files are needed? What files runs when and why? Here are the explanations and tips about WordPress template files.
First things first, what is a template exactly? A template is a PHP file that is a part of a theme. For example, there is a template for displaying the home page, one for displaying pages and another one for displaying posts.
What Are The Existing WordPress Tempaltes?
Here is a list of the existing WordPress templates that can be used in themes:
- index.php – The master template. If a certain template file does is not found, this one is being used.
- home.php – Displays the home page.
- page.php – Displays page’s page (It displays my contact page).
- single.php – Displays the post’s page (This is what you are now viewing if you are reading this here).
- author.php – Displays the author page. This is not such a common template as most themes don’t use author pages.
- tag.php – Displays the posts which have a specific tag. (e.g. FTP)
- category.php – Displays posts from a specific category. (e.g. WordPress)
- date.php – Displays posts from a specific time range.
- archive.php – Used if tag.php,category.php or date.php is not found.
- search.php – Displays search results. (e.g. How To)
- 404.php – When WordPress sends a 404 header. (When it cant find something)
- image.php,video.php,audio.php,application.php or any other first part of the attachment’s MIME type – Attachment.
- attachment.php – If one of the last templates (image.php…) are not found.
Here is a very useful image provided by WordPress Codex (click to enlarge):
Custom Templates
There are two main types of custom WordPress templates.
The first one are templates that WordPress looks for automatically, and if one is found it will be used. What the heck am I talking about?
If you have a category called “News” with the ID of 512 and you want the archive page of that category to have it’s own unique template you can create a new template file called category-512.php in the theme’s folder. And WordPress will use it.
This is the list of custom wordpress templates you can use:
- category-id.php
- tag-slug.php
- pagename.php
- firstpartoftheattachmentsMIMEtype.php

Now for the second type of WordPress custom templates.
Let’s say you have more then one page* you want to be displayed in a different way then the others. How do you do that?
Create a new file called whatever.php at your theme’s folder and inside write whatever you want instead of single.php or index.php (depending what displays the single posts at your theme).
Add this comment to the top of the file:
<?php
/*
Template Name: The Whatever Template Yo
*/
?>
(Of course change The Whatever Template Yo to the new template’s name)
Now edit (or create) the pages which you want to use this template and in the right side pick the desired template from the drop down menu. Just like in the screenshot at the right side.
*If you want to do this for posts rather then pages then you will find the Custom Post Template plugin very useful.
Any questions/corrections? Comments are always welcome.
Search terms:- wordpress template guide
- wordpress date php template
- 3590: String used where a Boolean value was expected The expression will be type coerced to Boolean in <mx:Image />
- wordpress custom templates
- it templates
- how to write song lyrics example
- wordpress templates guide
- attachment php wordpress
- attachment php wordpress 404
- date php wordpress template

Do you get “jQuery is not defined” as an error after a fresh WordPress Install? JavaScript not working at your admin panel? Don’t worry, I have the solution.
After installing two new WordPress installations with defective admin JavaScript that won’t allow me to
- Open the menus (in the admin panel’s left side)
- See the post editors toolbar
- Install new plugins
- Install new themes
I understood I was having some kind problem with the Javascript jQuery library.
I deactivated all the plugins and nothing happened. Then I started looking at the source code and googeling for quite a long time. After some serious research I discovered what caused the issue.
The Problem
While uploading the WordPress installation files onto the server I had some issues that cause some of the JavaScript files to not be uploaded / be corrupted.
The Solution

Re upload the wp-includes\js folder and overwrite whatever is in there.
That’s what fixed it for me.
I hope this helped someone, if it does, or does not – comment to help or get help.
Search terms:- wordpress jquery is not defined
- jQuery is not defined wordpress
- jquery is not defined
- $ is not defined
- wordpress jquery not defined
- jquery is not defined error
- jquery not defined wordpress
- wordpress jquery error
- wordpress admin jquery is not defined
I have received a request from someone that wants even more from my WordPress Custom Fields Plugin. He has a category called “videos” which has posts with YouTube videos embedded with some plugin. He wants to put the videos thumbnail as the post’s thumbnail.
First, how is the video embedded in the post? It uses the following syntax:
Now you can embed it like you would normally do.
Second, how do we get the thumbnail itself after we extracted the video key? We build the image’s URL with the following syntax:
http://i2.ytimg.com/vi/$video_key/default.jpg
Now, how do we put all of this together into a plugin that inserts the thumbnails?
You don’t have to because I have already done it for you.
- Visit the plugin page of YouTube Thumbnailer
- Download the plugin here
- Unzip it’s contents
- Upload the folder you unzipped to
/wp-content/plugins/using your favorite FTP client. - Go to your admin panel and activate the plugin called “Youtube Thumbnailer”
This plugin runs through the posts in your blog and if it finds a YouTube video embedded in a post it sets the thumbnail to be the video’s thumbnail.
That’s it, have fun playing with the configuration.
If you encounter any issues please comment/contact me.
Search terms:- youtube thumbnailer
- youtube thumbnail script
- youtube embed custom thumbnail
- embed youtube custom thumbnail
- video thumbnail youtube wordpress
- script youtube untuk wordpress
- script youtube thumb
- how to insert youtube video into wordpress as thumbnail
- embed youtube video with custom thumbnail
- embed youtube on website custom thumbnail

As you can see in the plugin‘s stats page, It currently has 1050 downloads!
Although the number may be not as big as other plugins (All in On SEO got over 2.5 million downloads), it means a lot to me. Every time you see numbers on the internet you don’t really think about them as you would outside the monitor. When viewing YouTube videos, if I see a video that has less then 5k views most of the times I won’t enter it and try to find another one with millions of views.
But when you think about the actual numbers it’s a huge amount of people sitting on their chair at home or at work, entering YouTube and watching the video. The same goes to plugin downloads, It’s really cool to know that my plugin helped over 300 (?) other people around the world that have their own website.
Update: It how has over 3000 downloads!
Search terms:- website hierarchy
- download hierarchy flash
- membership website hierarchy
- website hierarchy template
- wordpress youtuve attachment


