Build Your Own Business Website header image

Introduction to Customizing Thesis 2.1 Using PHP – Part 15 – Question and Answer

Difficulty Level -

Whoops, you've found some premium content!

Watch the opening clip of this video to preview it,
the full video is available to paid members.

How to Remove Dates from Posts

Now, we’re going to open this up to questions. Pete asks if this is being recorded. Yes, it’s being recorded and this will be posted sometime early next week on this. Charles said, “Do I need a box to remove the date from posts and will the old plugin still work in 2.1?” I don’t know what all the plugin you’re referring to but you can remove the date from the posts, depends on what you’re using.

If you’re using Classic Responsive Skin, you can remove the date from the posts using the Skin Content and if you don’t know this, you should be watch the Launch Party videos so that you understand how this works because you can use this Skin Content section to remove date. If you are using Thesis Classic and not Classic Responsive, then you have to drag the date out of the post box and put it into the tray and that’s the same thing you would do if you were using my Agility Skin so it just depends on the skin whether or not the skin has Thesis 2.1 content functionality or not.

How to Download the Sample Box

James asks, “Where’s the link to download the sample box”, and actually let me just walk you through the sample box here. So the way the sample box work is it gives you the type declaration and this shows you what your options are then it gives you the translate function, it gives you a construct function with a little bit of instruction and a preload function with a little bit of instruction. The construct, once when the box is loaded initialized and on every single page load anytime. The preload function only loads when the box appears on a template so if you’ve got something that you don’t want to happen on the entire site, you’d use the preload function rather than the construct function, class_options, this is the set of options that puts options under the boxes menu.

These options put options in the Skin Content, we’ve spent all time today talking about HTML options which actually put the options on the box itself although something to note is that, here I’m using the textarea options and checkbox options. Here I’m using a text option and a select option and here I’m using the radio option so you can see each of the different types of options in operation in each of these different potential option location whether it’s class_options, options or html_options and then I didn’t put anything in HTML except the magic $tab = str_repeat tab function that you may as well just use all the time. So that’s it, this is the simple box and this contains almost everything I ever include in a box. If you look at any of my boxes, you’ll see that this almost everything I included in a box is in one of these sections here.

Now, in terms of where are these on my site, if you go over to Seminars and just come down to Thesis Theme 2 Seminars, you’ll see Introduction to Customizing Thesis 2.1 Using PHP, it’s there under Seminar Resources where links to the codex, links to the Thesis Developer Documentation and links to that box are. Now, these videos you’ll also be able to access from here once the videos are edited and posted on the site and it would be just like any other seminar that I create.

Let’s see, Richard, there you go. Good morning, Richard. How are you doing?

Richard: Hey, this is such a great presentation, you clarified a lot of things for me.

Rick: Good.

Richard: But I really don’t have any questions, you’ve answered everything.

Rick: Oh, okay I see. I see actually. I didn’t actually read your question, I just saw you had your name on the list there 3 times so I figured out I’ll just let you ask them.

Richard: You really help us a lot.

Rick: Okay, good.

Richard: Thank you.

Rick: Well, you have a great day.

Richard: You too.

Is There a Way to Add Additional Images to the Excerpt?

Rick: Let’s see, James I have just unmuted your microphone. Em, are you there? Do you have a mic? Okay, it doesn’t sound like he do so the question you asked was, “Is there a way to add additional images to the excerpt?”. Well, what you mean by additional images to the excerpt? Ordinarily, what you’re talking about with an excerpt is either the WordPress featured image and so you add the WordPress featured image to the excerpt just by dragging that box into the okay, so adding more of the post. You know, and the way you can do that is you could call this a custom excerpt but instead of it actually being an excerpt, you could use the content and just have an automatic limiter of the content. So for example, I mean really, that’s a great question.

The excerpt removes all HTML out of the excerpt and you often end up seeing shortcode tags in there and stuff like that whereas the content doesn’t. The content renders all the HTML including images and including anything else and you could easily choose not to use the excerpt eventhough you call it an excerpt but choose to use the content but just limit the length of the content. So in our example here, although the excerpt_more and the excerpt_length would also be different right because there isn’t an excerpt length although I don’t think there is a content length either, let’s see, let’s look for the content.

The content uses the ‘more’ tag to make the separation and yeah, you’d have to do a little jiggery pokery with it. Say if you want to cut it off at 55 words, you’d have to get the filter content and then you just count the number of words in it or you could use the ‘more’ tag as the thing that makes the break that would automatically happen if you insert a ‘more’ tag. Sorry, let’s kind of restructure the answer again for a second. One, you would use the content rather than the excerpt and then you would not use the excerpt_length filter and the excerpt_more filter because it’s not an excerpt, you would instead filter the content by counting the words and reducing the number of words that are displayed of it in the content and then you would add a regular more traditional “Read More” link to it and it would look very much like this “Read More” link that we did. I mean the code would still look like you know, get_the_permalink, get_the_id but it wouldn’t be the excerpt_more filter, it would just be inside the HTML. So that’s how you would do it and still allow what looks like the excerpt to display HTML.

Mike asks if this code is going to be available for download after the seminar. In fact, when I’m done today I’ll go post it on the forum but then when these videos are posted, I actually have each individual step set aside and I will include with each video, there will be the code for that video as part of the seminar but I’ll go ahead and add this whole code to the code section of the forum so people have access to it right away. Okay, anybody else? Anything else? Well, if that is it, I haven’t announced this yet but next Tuesday, I plan on doing exactly the same thing for skins so the class is called Introduction to Creating Custom Thesis Skins in Thesis 2.1 and we’ll have a very similar format to this.

We’re going to be starting at the beginning and gradually building up a very simple skin obviously because we’re going to try to do it in the 2 or 3 hours available to us rather than the 8-10 weeks that I did the last class in but nevertheless, it’ll introduce you to the concept associated with the skin and how to use the Thesis 2.1 tools to create custom skins and we’ll be doing that next Tuesday. Tomorrow is the live Q&A session morning and evening, Thursday we’re doing the wrap up of the WP eStore eCommerce series and next week we start with WooCommerce and then on Friday, I believe we’re going to have a special seminar on setting up Amazon S3 for storing your large downloadable files for your WordPress site so we’ve got a pretty full schedule to come along here even though you don’t see it yet. Everybody have a lovely day and I look forward to chatting with you all again soon. Bye.

0 Comments… add one
0 comments… add one

Leave a Comment