Build Your Own Business Website header image

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.

Part 4 – Create the Genesis Child Theme Options Defaults

Difficulty Level -

Filed Under Topics -

Listed Under Lesson Subjects -

Applies to -

In the Anatomy of Genesis Child Theme Options video, I introduced the filter Genesis Theme Settings Defaults which holds all of the Genesis theme settings. So now in order for us to do anything with this, just like with any other filter, the filter passes the defaults as a variable.

Then we say add_filter and then the name of the filter and the name of our function which is byob_front_page_defaults. Essentially what we do is we just create defaults.

Create the First Default – Taxonomy

Let’s setup our first $default. It’s an array so we wrap the array element in those 2 square brackets, $default[‘box1_taxonomy’] and what you’re doing is just setting the default which in this case, will be ‘category’.

That’s our default although ultimately, they’ll be able to choose from category or tags so the first default is taxonomy.

Create the Second Default – the Term

The second default is [‘box1_term’]. So you’re going to pick the taxonomy term and in this case, we’re not going to set the defaults. It’s going to be blank.

Create the Third Default – Posts to Show

Then the third default will be [‘box1_post_to_show’] and we will set that to 3. Well, let’s make sure that’s an integer. As I recall from our other code it was an integer. Let’s come up here and look. Yes, posts_per_page is 3 so post_to_show is 3.

So we’ve set defaults for [‘box1_taxonomy’], that’s the name of the setting, [‘box1_term’] and [‘box1_post_to_show’]. In fact, we’re going to come down here and repeat this for box2 and box3.

And those are the 9 settings that we are adding to this child theme. The taxonomy, The term and the post_to_show.

Save $200 on Membership Now!

Start learning today for as little as
$0.82 PER DAY!
Subscription Options
0 Comments… add one
0 comments… add one

Leave a Comment