Thesis Video Tutorial: Customize Thesis with WordPress Custom Fields

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more

Sharing is caring!

Last Updated on May 7, 2019

Today’s quick Thesis Video tutorial will demonstrate how you can easily access WordPress Custom fields via Thesis Hooks. If you have been exposed to the power of Custom Fields, this tutorial will be great for you. If you haven’t used them you may want to read up on them at the WordPress Codex. Custom fields are how Michael Gray built his Thesis Carousel and how many other “Premium” WordPress display special information, such as “featured images.”

Within this tutorial we will guide you through how to use Thesis to display your own “featured images.” In a few weeks we will use this code to build a full featured slider for your theme. Once you have a mastery of WordPress Custom Fields you can essentially make Thesis do anything under the sun.

Bonus: While recording the video I realized some people may want to only show the hook they are modifying to themselves. So I’ve included this code as well. Remember to add your IP Address or you won’t see the hook either. :) If you want to know your IP Address look in the sidebar.

Please Note This is an Old tutorial. The examples used have changed.

Within this Video we used the following Thesis Hook:

<? function thesis_custom_field_training(){ global $post; global $more; $YourIP = array('',''); /* Add your IP Address Here*/ if (in_array ($_SERVER['REMOTE_ADDR'], $YourIP)) { if(is_home()){ //Is the Home Page $my_custom_query = new WP_Query('showposts=1'); //Custom Query - Find the First Post while ($my_custom_query->have_posts()) : $my_custom_query->the_post();
					$key = 'training_text'; // Our Custom Field Name
					$img_array =	get_post_custom_values($key); //Holding array
					$featuredimage = $img_array[0]; //Assign Value

		<? endwhile; } } } add_action('thesis_hook_before_content','thesis_custom_field_training'); ?>

As explained in the video this hook, accesses the “thesis_post_image” custom field for our most recent post and assigns it to a variable. We then output the variable to the screen.

I am sure you will find this quick tutorial of use, especially if you want to take your Thesis Customizations to the next level.

If you have any questions or comments please leave them below.

Nick Reese is a multi-passionate entrepreneur who believes anyone can transform their business and life they they’ve got guts and hustle. He’s also the co-founder of Broadband Now which aims to simplify the broadband shopping process.