Removing Meta From Vogue Theme

You may have chosen a WordPress theme that nests its functionality within subfolders. Some of these subfolders may not be accessible from the 'Appearance' - 'Editor' panel. For example, if you see references to something like templates/content/content.php in your single.php file and you can't find content.php listed in your available files for editing, you might be in this situation.

In these cases, it's necessary to access your theme files via an alternate method. At present, alternate access methods are only available to your instructor. However, I am creating this tutorial with the hopes that you may find it helpful in your future careers.

After logging-into your server (provided you have SFTP, WebDAV, or SSH access to your site), you can drill-down to your themes directory inside wp-content. In the screenshot below, I have navigated inside of our Vogue theme directory. Vogue is the example theme we are working with today that uses a nested file structure.

Above, you can see the many directories that are available to us through SFTP (secure file transfer protocol) by way of Cyberduck in this case.

If you drill-down yet further (into the templates directory), you will see the directories (and files within) that are missing from your in-browser editor.

Above, I've drilled-down all the way into the templates/content directory that I mentioned previously.

I'm going to show you the code that exists in content.php for this theme (Vogue).

The custom WordPress function 'vogue_posted_on' is printing the date above WordPress content in this theme. The developers of Vogue would like you to pay to toggle-off this custom function. But, with server access and a bit of know-how, we can remove it by simply deleting the div containing 'vogue_posted_on'.

You might be curious to know where 'vogue_posted_on' is defined. Can you modify it rather than deleting it? Sure. You certainly can. Many theme-specific functions end up being defined or included via functions.php, so that's where we need to do some detective work.

In functions.php in this theme, you'll see the following: require get_template_directory() . '/includes/inc/template-tags.php';

We have an 'includes' directory that contains an 'inc' directory that holds our custom template tags. Why have an 'inc' folder inside of 'includes'? Yikes, I can't explain that one. I would not have have written it that way. Ha. But, back to our central question... What does 'vogue_posted_on' really do? Where do we find it?

We find our answer to this question after journeying into template_tags.php. At the top of that file, we see the 'vogue_posted_on' function.

function vogue_posted_on() { $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; }

As you can see above, it includes either the publish date of the post or the modify date of the post. If you were using this theme as a blog, this functionality would be kind of nice. You aren't stuck with the original publish date forever on a post. The function is smart enough to change your listed date after an update.