Customising Oxygen Theme to show new posts and the Image Slider

Customising Oxygen Theme to show new posts and the Image Slider

I recently upgraded WordPress to 3.9 and my theme (called Neptumiumize) seemed to be conflicting with it: even though the front end of the site worked, the Wordpress back end started to fail in lots of little ways.

So I decided to upgrade to a new theme, called Oxygen. It’s nice and clean, and it’s also responsive.

The problem is that although Oxygen works really well once you install it, it’s a bit clunky when it comes to setting up the front end. Oxygen offers a choice between two layouts for the front page.

  • The first offers a lovely featured posts slider, but requires each and every post appearing underneath the slider to be curated in some way. This involves going back through historical posts and setting them to appear. This is an overhead I don’t want to manage with every post.
  • The second option shows blog posts newest-oldest as is typical for a blog, but doesn’t include the slider.

I’m not very good with PHP, so after trying to pick apart the code, I turned to Reddit for advice (the wordpress support forums were very quiet).  A user called “Woket” pointed me at the answer.

The trick is to pull the Featured Content template into the index.php, right after the header.php is included and before the aside. Here’s a fragment of the code to illustrate this (I’ve also highlighted the part you’ll need to paste in):

* Index Template
* This is the default template. It is used when a more specific template can’t be found to display
* posts. It is unlikely that this template will ever be used, but there may be rare cases.
* @package Oxygen
* @subpackage Template

get_header(); // Loads the header.php template. ?>
<?php get_template_part( ‘featured-content’ ); // Loads the featured-content.php template. ?>

<div class=”aside”>

<?php get_template_part( ‘menu’, ‘secondary’ ); // Loads the menu-secondary.php template. ?>

<?php get_sidebar( ‘primary’ ); // Loads the sidebar-primary.php template. ?>



Related Posts Plugin for WordPress, Blogger...