free hit counters
If you are using Internet Explorer as your browser please be running at least IE 7 or above. This site does not support IE 6 or below. Go here for the latest free version including easy download and installation instructions If you want to make it real easy on yourself, download Firefox , the most popular browser in the world. It's free and simple. You'll be so glad you did.
Jan
30
2009

Using the feature box

Thesis 1.4 comes with a new feature called the “feature box”. It can be found here….

Dashboard—-> Appearance —-> Design Options….

71

As it sits right now the feature box will not show up on your site until you implement it with a hook. Here’s an example of how to put just text in the feature box…

72

In your custom_functions.php file add the following code. You can put it anywhere you want but I recommend putting it at the top after the <?php tag. Remember, once you make the change, save it, and upload it to your server. Always describe the function and put it between the comment tags /*  */ at the beginning shown below in green. The comments aren’t shown on your rendered page and it just makes things easier for you to remember…

/*use the feature box below header*/
function text (){
echo ‘<div class=”textbox”>some stuff in the feature box</div>’;
}
add_action(’thesis_hook_feature_box’, ‘text’);

Name your function whatever you want. In this case I named it “text”

I gave it a div so I could style it in my custom.css

It will be placed according to the choice I chose in the drop down menu, being full width above content and sidebars in this scenario

It will show up on every page and post because I chose “sitewide” instead of “on homepage only”

Now you can style it any way you want…

In your custom.ss file add the following code. You can put it anywhere you want but I recommend putting it at the top. Remember, once you make the change, save it, and upload the new file to your server. Always describe what you’re doing by putting your descripton between the comment tags /*  */ at the beginning shown below in green. The comments aren’t shown on your rendered page and it just makes things easier for you to remember…

/*text in feature box*/
custom .textbox {
border: 1px solid;
background: red;
font-size: 2em;
width: 100%;
text-align: center;
padding: 2em 0 2em 0;
}

Feel free to change any of these to create your desired effect

Leaving a comment with code in it...

If you would like to leave a comment and you have examples of code you want to show, you must "escape the code". This allows the entire code to show correctly by inserting certain variable around certain tags to make them show. If you don't "escape the code" your code will show up broken, mangled, and it won't be able to be seen correctly. "Escaping the code" is very simple...

  1. Copy your code you want to show
  2. Click here to go to the site to escape the code
  3. Follow the directions, it's so easy
  4. Once you have the escaped code copied, paste it in the comments area where you want
  5. Now you can enjoy life


Go ahead, leave a comment...

{ 4 comments… read them below or add one }

John H. Farr February 2, 2009 at 1:24 am

I just wanted to say thanks. I’m in a big hurry, and I’ve gotten some good tips here.

Reply

akamaxbuz February 25, 2009 at 11:13 am

Thanks, but…
I copied and pasted this into DreamWeaver:
/*use the feature box below header*/
function text (){
echo ‘ some stuff in the feature box’;
}
add_action(’thesis_hook_feature_box’, ‘text’);

And then I got errors. Looking closely, the single quotes pasted in as curly single quotes instead of the correct ” ‘ ” straight kind. Maybe it was just me.

Reply

Geirmund Knutsen February 26, 2009 at 10:44 am

Thanks for the help with this hook.

Mind the apostrophes in the function. It should read:

/* use the feature box below header */
function taster() {
echo ’some stuff in the feature box’;
}
add_action(’thesis_hook_feature_box’, ‘taster’);

Mind the space in the css. It should read:

/*text in feature box*/
custom.textbox {
border: 1px solid;
background: red;
font-size: 2em;
width: 100%;
text-align: center;
padding: 2em 0 2em 0;
}

Reply

Denise May 4, 2009 at 8:22 am

This was a great help. Very clear and easy to follow instructions. They helped me get our feature box setup very quickly.

thanks again

Reply

Leave a Comment

Previous post: Change the font in the footer

Next post: Change the title of your blog