July 18, 2017 Victor

My New WordPress Child Theme with Extra Features

This WordPress theme is a child theme based on the popular Brooklyn theme by United Themes. The Brooklyn theme is a very child friendly theme so it allows you to add more features if you choose to.

My goal is to take advantage of the original theme features and add to them.

The New Features:

  1. A Font Awesome icon assigned to a category, tag or format choice on post titles.
  2. The original theme gives you a video full screen option for the front page only. Changed this feature so that any page can have a full screen video option.
  3. A unique video displayed based on category selection with a default video fallback.
  4. Added a dynamic link to the logo’s anchor element. If you are on the front page, it’s a ‘scroll to top’ link. Otherwise, it functions as a ‘home link’.

    This is the function:

    function grav_to_top() {
        if ( is_front_page() ) {
          echo '#top" class="grav';
        } else {
          echo esc_url( home_url( '/' ) );
        }
    }

    This function is added to the anchor element’s href attribute for the logo. It looks like this:

    <div class="site-logo">	
      <a href="<?php echo grav_to_top(); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img data-altlogo="<?php echo $alternate_logo; ?>" src="<?php echo $sitelogo; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"></a>
    </div>
  5. By default, the parent theme does not have an audio format option. I added that to the child theme and assigned a musical notes icon to the post title.
  6. Added the ‘wp_kses‘ function to the ‘comments_popup_link‘ function so that I can style the comment number.

These are just a few changes that I made using a child theme. The parent theme comes with an assortment of powerful shortcode options. I chose to customize some of them to include more options and that was accomplished without ever changing the original files.

I enjoy working with WordPress and discovering ways to make it more powerful and beautiful.

Tagged:

Design, Development, and Creative Interests