Posted on Leave a comment

“SubTitle” for all My YUI-CSS Grids and Hybrid Based WordPress Themes

Hybrid WordPress Theme Subtitler Display
Hybrid WordPress Theme Subtitler Display
Hybrid WordPress Theme Subtitler Display

I have been using “sub-title” or entry-subtitle for all my Child Themes that I develop utilizing the rock-solid, most comprehensive and most customize-able Hybrid WordPress theme by Justin Tadlock.

Oh, yes, there are sub-title or subtitler WordPress Plugins available, but I use this as my “extensions” on all my child-themes. The easiest solution is just download those plugins, activate and use them. But frankly, I do not like so much “external control” over my themes, because those plugins are created for you and those creators can change anything they want and it might go in a direction that you didn’t anticipate. In other words, it is personally safe to use your own “file”

Plugin Name: Subtitler
Plugin URI: http://spidermarket.com
Description: Adds Subtitles to your WordPress posts. Called using the template tag the_subtitle.
Version: 1.0
Author: Joshua Unseth
Author URI: http://spidermarket.com
*/

You can visit this URL to see how it works but this blog and other blogs that I created such as follows:

  1. http://papua.church
  2. http://papua.pw
  3. http://melanesia.net
  4. http://papua.name
  5. http://otsus.blog

and many others

I am talking based on the language and structure of “themehybrid.com” by Justin Tadlock. I call “subtitler.php” from my “hybrid.php” parallel file that I created for my child theme.

Here are the steps

  1. First copy the subtitler.php code that I have left in my Plugin entry.
  2. Then paste the code into your “functions.php” file or you can also create as a separate file as I am doing, and call it from either functions.php or as I am doing, I am calling from a parallel file to default “hybrid.php” that I call “hybrid-child.php” or other files it is up to you.
  3. That is it. It is done. The in your theme, just call
    "<?php echo the_subtitle(); ?>
  4. You can either put it before the default “entry_title”, or after that.
  5. I normally give a different colour or font-style or font-face, in order to make it stand out, as mostly people do not expect “subtitle” or it is not common right now.
  6. According to hybrid themes css style, I give  stylesheet names: “.entry-title” and “.entry-subtitle”

Below is the code I use in my hybrid child theme “functions.php”

First above, I do the “remove_action” to remove the Hybrid Core entry_title();


/* Add the title, byline, and entry meta before and after the entry. */
remove_action( "{$prefix}_before_entry", 'hybrid_entry_title' );
add_action( "{$prefix}_before_entry", 'hybrid_child_entry_title' );

Because I have removed the theme entry_title(); so now I create hybrid_child_title(); in which I add “the_subtitle():” as follows. Yes, I forgot, the sub-title here is in Shortcode, because I have also created shortcode for sub-title in my child-theme “shortcodes.php” file.

/**
* HyrirdChild way to display the post title with post sub-title.
* Separate shortcode was created for the_subtitle at 'functions/shortcodes.php'
*
* @since 1.9
*/
function hybrid_child_entry_title() {
echo apply_atomic_shortcode( 'entry_title', '[entry-title]' );
echo '';
echo apply_atomic_shortcode( 'entry_subtitle', '[entry-subtitle]' );
echo '
';
}

PS:

  • I hope this is useful
  • Please not I am not part of this modern world, so my English is not very good, and my skills in internet and blogging are also very basic. Please do understand that I am writing this for myself so that I do not forget it.
  • If you have any suggestions or advice, or want to support me, please email: info@wpyui.com

 

Leave a Reply

Your email address will not be published. Required fields are marked *