• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Elegant Themes: After Single Post Content Widget For Foxy Theme

There’s at least 2 ways you can add a custom widget which displays after the content on single posts in any Elegant theme.

In this post, we’ll add the new widget area directly to the single.php file which we’ll copy over to a child theme before modifying.

Foxy Theme

Note: The code in this tutorial has been tested on the Foxy theme using a child theme. The child theme saves your custom code/modifications from being lost if the parent theme is updated in the future.

Demo Foxy Parent Theme

There’s 2 steps involved:

  1. Register a new sidebar widget area in your child themes functions file.
  2. Add the dynamic sidebar wrapped in a div directly to your single.php file

1. Register Widget

Simply copy this PHP code from the view raw link and paste in your functions.php file using a code editor. Preferably use a child theme which won’t be over written if your parent theme is updated.

Here’s a child theme for Foxy ( you can download the zip from Github ) which already includes the after post widget code so you can simply install it after the parent theme is installed.

Download Zip – Foxy Child Theme

No need to read on if you download & install the Foxy child theme zip after the parent theme.

2. Add Dynamic Sidebar To Single.php File

Add this PHP around Line 34 of your single.php file.

If you’re not adding this widget to Foxy, add the code after this line:

<?php get_template_part( 'content', get_post_format() ); ?>

and before the code for the comments in any other Elegant Theme.

Code Not Working

View the code in the single.php & functions.php files on Github to check against your own.

View Code on Github

Reader Interactions

Comments

  1. Val Lynn says

    July 17, 2014 at 12:04 am

    And here I thought you only covered one theme shop. Good to see you posting about Elegant Themes. You’re the best!

    Log in to Reply
    • Brad Dalton says

      July 17, 2014 at 1:38 am

      Better late than never! haha

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems