Passing the function into action

Now that we have the theme_setup function, we need to pass this function into an action. So let's add add_action and the action will be after_setup_theme. The second parameter will be the function we want to run, which is theme_setup as shown here:

function theme_setup(){
// Featured Image Support
add_theme_support('post-thumbnails');

set_post_thumbnail_size(900, 600);

// Post Format Support
add_theme_support('post-formats', array('gallery'));
}

add_action('after_setup_theme', 'theme_setup');

Now, let's save this code and reload the backend page. As shown in the following screenshot, you will now see that we have the Featured Image section under the Tags section, and we also have support for the gallery format:

Now since we have both standard and gallery formats, we need to create the two different files for the content. In the photogenik folder create one file for content, as content.php, and another for gallery, as content-gallery.php.

Before we actually work on these files, we will simplify our index.php file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.234.28