Closed travelinboots closed 10 years ago
Hi @travelinboots. The only way that Subtitles will not be shown by default is if your theme is using non-standard Loops. Please see the FAQ and look into using the_subtitle
or get_the_subtitle
for your needs. Hope that helps and let me know how it goes.
Look under the Using Template Tags section and put one of those template tags into your single.php
file. That should be enough.
Hello Philip, I copied and pasted the code in my single.php file but it didn't work.
@travelinboots If those are pages then you might need to do the same thing in page.php
. The advice I gave you was just for posts. Try the page.php
file as well.
Can you post the code from your single.php
file here?
Sure hold on.
<?php
/**
* The template used for displaying page content in page.php
*
* @package ThemeGrill
* @subpackage Spacious
* @since Spacious 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php do_action( 'spacious_before_post_content' ); ?>
<div class="entry-content clearfix">
<?php
the_content();
wp_link_pages( array(
'before' => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Next Page:', 'spacious' ),
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>'
) );
$spacious_tag_list = get_the_tag_list( '', ' ', '' );
if( !empty( $spacious_tag_list ) ) {
?>
<div class="tags">
<?php
_e( 'Tagged on: ', 'spacious' ); echo $spacious_tag_list;
?>
</div>
<?php
}
?>
</div>
<footer class="entry-meta-bar clearfix">
<div class="entry-meta clearfix">
<span class="by-author"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a></span>
<span class="date"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( get_the_time() ); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a></span>
<?php if( has_category() ) { ?>
<span class="category"><?php the_category(', '); ?></span>
<?php } ?>
<?php if ( comments_open() ) { ?>
<span class="comments"><?php comments_popup_link( __( 'No Comments', 'spacious' ), __( '1 Comment', 'spacious' ), __( '% Comments', 'spacious' ), '', __( 'Comments Off', 'spacious' ) ); ?></span>
<?php } ?>
<?php edit_post_link( __( 'Edit', 'spacious' ), '<span class="edit-link">', '</span>' ); ?>
</div>
</footer>
<?php
do_action( 'spacious_after_post_content' );
?>
</article>
Where's this?
<div class="header-post-title-container clearfix">
<div class="inner-wrap">
<div class="post-title-wrapper">
<h1 class="header-post-title-class">An Eerie Wander Through The Forest of Kanmangafuchi Abyss</h1>
</div>
</div>
</div>
Is that in your header.php
file?
I pasted the wrong code. I apologize. This is the correct one:
<?php
/**
* Theme Single Post Section for our theme.
*
* @package ThemeGrill
* @subpackage Spacious
* @since Spacious 1.0
*/
?>
<?php get_header(); ?>
<?php do_action( 'spacious_before_body_content' ); ?>
<div id="primary">
<div id="content" class="clearfix">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'single' ); ?>
<?php get_template_part( 'navigation', 'archive' ); ?>
<?php
do_action( 'spacious_before_comments_template' );
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() )
comments_template();
do_action ( 'spacious_after_comments_template' );
?>
<?php endwhile; ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php spacious_sidebar_select(); ?>
<?php do_action( 'spacious_after_body_content' ); ?>
<?php get_footer(); ?>
I still don't see the_title
there. I'm thinking it's probably in your header.php
file.
Hmm odd. Here's my header.php
<?php
/**
* Theme Header Section for our theme.
*
* Displays all of the <head> section and everything up till <div id="main" class="clearfix"> <div class="inner-wrap">
*
* @package ThemeGrill
* @subpackage Spacious
* @since Spacious 1.0
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
<?php
/**
* Print the <title> tag based on what is being viewed.
*/
wp_title( '|', true, 'right' );
?>
</title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
/**
* This hook is important for wordpress plugins and other many things
*/
wp_head();
?>
</head>
<body <?php body_class(); ?>>
<?php do_action( 'before' ); ?>
<div id="page" class="hfeed site">
<?php do_action( 'spacious_before_header' ); ?>
<header id="masthead" class="site-header clearfix">
<?php if( of_get_option( 'spacious_activate_top_header_bar', 0 ) == 1 ) { ?>
<div id="header-meta" class="clearfix">
<div class="inner-wrap">
<?php
if( of_get_option( 'spacious_activate_social_links', 0 ) == 1 ) { spacious_social_links(); }
spacious_header_info_text();
?>
<nav class="small-menu" class="clearfix">
<?php
if ( has_nav_menu( 'header' ) ) {
wp_nav_menu( array( 'theme_location' => 'header', 'depth' => -1 ) );
}
?>
</nav>
</div>
</div>
<?php } ?>
<?php if( of_get_option( 'spacious_header_image_position', 'above' ) == 'above' ) { spacious_render_header_image(); } ?>
<div id="header-text-nav-container">
<div class="inner-wrap">
<div id="header-text-nav-wrap" class="clearfix">
<div id="header-left-section">
<?php
if( ( of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'both' || of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'logo_only' ) && of_get_option( 'spacious_header_logo_image', '' ) != '' ) {
?>
<div id="header-logo-image">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo of_get_option( 'spacious_header_logo_image', '' ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"></a>
</div><!-- #header-logo-image -->
<?php
}
if( of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'both' || of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'text_only' ) {
?>
<div id="header-text">
<h1 id="site-title">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
</h1>
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2><!-- #site-description -->
</div><!-- #header-text -->
<?php
}
?>
</div><!-- #header-left-section -->
<div id="header-right-section">
<?php
if( is_active_sidebar( 'spacious_header_sidebar' ) ) {
?>
<div id="header-right-sidebar" class="clearfix">
<?php
// Calling the header sidebar if it exists.
if ( !dynamic_sidebar( 'spacious_header_sidebar' ) ):
endif;
?>
</div>
<?php
}
?>
<nav id="site-navigation" class="main-navigation" role="navigation">
<h1 class="menu-toggle"><?php _e( 'Menu', 'spacious' ); ?></h1>
<?php
if ( has_nav_menu( 'primary' ) ) {
wp_nav_menu( array( 'theme_location' => 'primary' ) );
}
else {
wp_page_menu();
}
?>
</nav>
</div><!-- #header-right-section -->
</div><!-- #header-text-nav-wrap -->
</div><!-- .inner-wrap -->
</div><!-- #header-text-nav-container -->
<?php if( of_get_option( 'spacious_header_image_position', 'above' ) == 'below' ) { spacious_render_header_image(); } ?>
<?php
if( of_get_option( 'spacious_activate_slider', '0' ) == '1' ) {
if ( ( of_get_option( 'spacious_slider_status', 'home_front_page' ) == 'all_page' ) || ( ( is_home() || is_front_page() ) && of_get_option( 'spacious_slider_status', 'home_front_page' ) == 'home_front_page' ) ) {
spacious_pass_slider_parameters();
spacious_featured_image_slider();
}
}
if( ( '' != spacious_header_title() ) && !( is_home() || is_front_page() ) ) {
?>
<div class="header-post-title-container clearfix">
<div class="inner-wrap">
<div class="post-title-wrapper">
<?php
if( '' != spacious_header_title() ) {
?>
<h1 class="header-post-title-class"><?php echo spacious_header_title(); ?></h1>
<?php
}
?>
</div>
<?php if( function_exists( 'spacious_breadcrumb' ) ) { spacious_breadcrumb(); } ?>
</div>
</div>
<?php
}
?>
</header>
<?php do_action( 'spacious_after_header' ); ?>
<?php do_action( 'spacious_before_main' ); ?>
<div id="main" class="clearfix">
<div class="inner-wrap">
Looks like the theme is using a custom title function, which is why the plugin doesn't work out of the box:
<?php echo spacious_header_title(); ?>
Look for this line:
<h1 class="header-post-title-class"><?php echo spacious_header_title(); ?></h1>
Change it to the following:
<h1 class="header-post-title-class">
<?php echo spacious_header_title(); ?>
<span class="entry-subtitle">
<?php if ( function_exists( 'the_subtitle' ) ) { echo get_the_subtitle(); } ?>
</span>
</h1>
Holy cow it's working now!! Thank you!! Very genius!
This would actually be a little better:
<h1 class="header-post-title-class">
<?php echo spacious_header_title(); ?>
<?php if ( function_exists( 'the_subtitle' ) ) { ?>
<span class="entry-subtitle">
<?php echo get_the_subtitle(); ?>
</span>
<?php } ?>
</h1>
Glad that it worked. Leave me a plugin review on WordPress.org if you have some time. :smile:
Hello Philip, I just found out that there's an extra code showing under the Subtitles when viewed on a different page: http://www.travelinboots.com/blog/
I wonder why there's an extra "> there and how to remove it. I check the codes and couldn't find anything.
Can you post your code again? I can look at this in an hour or two when I get up. :) On Aug 16, 2014 7:31 AM, "travelinboots" notifications@github.com wrote:
Hello Philip, I just found out that there's an extra code showing under the Subtitles when viewed on a different page: http://www.travelinboots.com/blog/
I wonder why there's an extra "> there and how to remove it. I check the codes and couldn't find anything.
— Reply to this email directly or view it on GitHub https://github.com/philiparthurmoore/Subtitles/issues/25#issuecomment-52376491 .
Ooops sorry to wake you up! But here's the code
<?php
/**
* Theme Header Section for our theme.
*
* Displays all of the <head> section and everything up till <div id="main" class="clearfix"> <div class="inner-wrap">
*
* @package ThemeGrill
* @subpackage Spacious
* @since Spacious 1.0
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
<?php
/**
* Print the <title> tag based on what is being viewed.
*/
wp_title( '|', true, 'right' );
?>
</title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
/**
* This hook is important for wordpress plugins and other many things
*/
wp_head();
?>
</head>
<body <?php body_class(); ?>>
<?php do_action( 'before' ); ?>
<div id="page" class="hfeed site">
<?php do_action( 'spacious_before_header' ); ?>
<header id="masthead" class="site-header clearfix">
<?php if( of_get_option( 'spacious_activate_top_header_bar', 0 ) == 1 ) { ?>
<div id="header-meta" class="clearfix">
<div class="inner-wrap">
<?php
if( of_get_option( 'spacious_activate_social_links', 0 ) == 1 ) { spacious_social_links(); }
spacious_header_info_text();
?>
<nav class="small-menu" class="clearfix">
<?php
if ( has_nav_menu( 'header' ) ) {
wp_nav_menu( array( 'theme_location' => 'header', 'depth' => -1 ) );
}
?>
</nav>
</div>
</div>
<?php } ?>
<?php if( of_get_option( 'spacious_header_image_position', 'above' ) == 'above' ) { spacious_render_header_image(); } ?>
<div id="header-text-nav-container">
<div class="inner-wrap">
<div id="header-text-nav-wrap" class="clearfix">
<div id="header-left-section">
<?php
if( ( of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'both' || of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'logo_only' ) && of_get_option( 'spacious_header_logo_image', '' ) != '' ) {
?>
<div id="header-logo-image">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo of_get_option( 'spacious_header_logo_image', '' ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"></a>
</div><!-- #header-logo-image -->
<?php
}
if( of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'both' || of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'text_only' ) {
?>
<div id="header-text">
<h1 id="site-title">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
</h1>
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2><!-- #site-description -->
</div><!-- #header-text -->
<?php
}
?>
</div><!-- #header-left-section -->
<div id="header-right-section">
<?php
if( is_active_sidebar( 'spacious_header_sidebar' ) ) {
?>
<div id="header-right-sidebar" class="clearfix">
<?php
// Calling the header sidebar if it exists.
if ( !dynamic_sidebar( 'spacious_header_sidebar' ) ):
endif;
?>
</div>
<?php
}
?>
<nav id="site-navigation" class="main-navigation" role="navigation">
<h1 class="menu-toggle"><?php _e( 'Menu', 'spacious' ); ?></h1>
<?php
if ( has_nav_menu( 'primary' ) ) {
wp_nav_menu( array( 'theme_location' => 'primary' ) );
}
else {
wp_page_menu();
}
?>
</nav>
</div><!-- #header-right-section -->
</div><!-- #header-text-nav-wrap -->
</div><!-- .inner-wrap -->
</div><!-- #header-text-nav-container -->
<?php if( of_get_option( 'spacious_header_image_position', 'above' ) == 'below' ) { spacious_render_header_image(); } ?>
<?php
if( of_get_option( 'spacious_activate_slider', '0' ) == '1' ) {
if ( ( of_get_option( 'spacious_slider_status', 'home_front_page' ) == 'all_page' ) || ( ( is_home() || is_front_page() ) && of_get_option( 'spacious_slider_status', 'home_front_page' ) == 'home_front_page' ) ) {
spacious_pass_slider_parameters();
spacious_featured_image_slider();
}
}
if( ( '' != spacious_header_title() ) && !( is_home() || is_front_page() ) ) {
?>
<div class="header-post-title-container clearfix">
<div class="inner-wrap">
<div class="post-title-wrapper">
<?php
if( '' != spacious_header_title() ) {
?>
<h1 class="header-post-title-class">
<?php echo spacious_header_title(); ?>
<?php if ( function_exists( 'the_subtitle' ) ) { ?>
<span class="entry-subtitle">
<?php echo get_the_subtitle(); ?>
</span>
<?php } ?>
</h1>
<?php
}
?>
</div>
<?php if( function_exists( 'spacious_breadcrumb' ) ) { spacious_breadcrumb(); } ?>
</div>
</div>
<?php
}
?>
</header>
<?php do_action( 'spacious_after_header' ); ?>
<?php do_action( 'spacious_before_main' ); ?>
<div id="main" class="clearfix">
<div class="inner-wrap">
That's the wrong file. On Aug 16, 2014 8:31 AM, "travelinboots" notifications@github.com wrote:
Ooops sorry to wake you up! But here's the code
<?php /**
- Implements a custom header for Spacious.
- See http://codex.wordpress.org/Custom_Headers *
- @package https://github.com/package ThemeGrill
- @subpackage Spacious
- @since https://github.com/since Spacious 1.0 */
/**
- Setup the WordPress core custom header feature. *
- @uses https://github.com/uses spacious_header_style()
- @uses https://github.com/uses spacious_admin_header_style()
- @uses https://github.com/uses spacious_admin_header_image() *
- @package https://github.com/package spacious */ function spacious_custom_header_setup() { add_theme_support( 'custom-header', apply_filters( 'spacious_custom_header_args', array( 'default-image' => '', 'default-text-color' => '222222', 'width' => 1400, 'height' => 400, 'flex-width' => true, 'flex-height' => true, 'wp-head-callback' => 'spacious_header_style', 'admin-head-callback' => 'spacious_admin_header_style', 'admin-preview-callback' => 'spacious_admin_header_image', ) ) ); } add_action( 'after_setup_theme', 'spacious_custom_header_setup' );
if ( ! function_exists( 'spacious_header_style' ) ) :
/**
-
Styles the header text displayed on the blog. / function spacious_header_style() { $header_text_color = get_header_textcolor();
// If no custom options for text are set, let's bail // get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value if ( HEADER_TEXTCOLOR == $header_text_color ) { return; }
// If we get this far, we have custom styles. Let's do this. ?> <?php // Has the text been hidden? if ( 'blank' == $header_text_color ) : ?> #site-title, #site-description { position: absolute; clip: rect(1px, 1px, 1px, 1px); } <?php // If the user has set a custom color for the text use that else : ?> #site-title a { color: #<?php echo $header_text_color; ?>; } #site-description { color: #<?php echo $header_text_color; ?>; } <?php endif; ?>
<?php } endif; // spacious_header_style
if ( ! function_exists( 'spacious_admin_header_style' ) ) : /**
- Styles the header image displayed on the Appearance > Header admin panel. *
- @see https://github.com/see spacious_custom_header_setup(). */ function spacious_admin_header_style() { ?> .appearance_page_custom-header
headimg { border: none; } #headimg h1, #desc { } #headimg h1 { } #headimg
h1 a { text-decoration: none; } #desc { } #headimg img { } <?php } endif; // spacious_admin_header_style
if ( ! function_exists( 'spacious_admin_header_image' ) ) : /**
- Custom header image markup displayed on the Appearance > Header admin panel. *
- @see https://github.com/see spacious_custom_header_setup(). */ function spacious_admin_header_image() { $style = sprintf( ' style="color:#%s;"', get_header_textcolor() ); ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?>
<?php bloginfo( 'description' ); ?> <?php if ( get_header_image() ) : ?>
— Reply to this email directly or view it on GitHub https://github.com/philiparthurmoore/Subtitles/issues/25#issuecomment-52378402 .
Sorry. UGH.
<?php
/**
* Theme Header Section for our theme.
*
* Displays all of the <head> section and everything up till <div id="main" class="clearfix"> <div class="inner-wrap">
*
* @package ThemeGrill
* @subpackage Spacious
* @since Spacious 1.0
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
<?php
/**
* Print the <title> tag based on what is being viewed.
*/
wp_title( '|', true, 'right' );
?>
</title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
/**
* This hook is important for wordpress plugins and other many things
*/
wp_head();
?>
</head>
<body <?php body_class(); ?>>
<?php do_action( 'before' ); ?>
<div id="page" class="hfeed site">
<?php do_action( 'spacious_before_header' ); ?>
<header id="masthead" class="site-header clearfix">
<?php if( of_get_option( 'spacious_activate_top_header_bar', 0 ) == 1 ) { ?>
<div id="header-meta" class="clearfix">
<div class="inner-wrap">
<?php
if( of_get_option( 'spacious_activate_social_links', 0 ) == 1 ) { spacious_social_links(); }
spacious_header_info_text();
?>
<nav class="small-menu" class="clearfix">
<?php
if ( has_nav_menu( 'header' ) ) {
wp_nav_menu( array( 'theme_location' => 'header', 'depth' => -1 ) );
}
?>
</nav>
</div>
</div>
<?php } ?>
<?php if( of_get_option( 'spacious_header_image_position', 'above' ) == 'above' ) { spacious_render_header_image(); } ?>
<div id="header-text-nav-container">
<div class="inner-wrap">
<div id="header-text-nav-wrap" class="clearfix">
<div id="header-left-section">
<?php
if( ( of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'both' || of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'logo_only' ) && of_get_option( 'spacious_header_logo_image', '' ) != '' ) {
?>
<div id="header-logo-image">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo of_get_option( 'spacious_header_logo_image', '' ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"></a>
</div><!-- #header-logo-image -->
<?php
}
if( of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'both' || of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'text_only' ) {
?>
<div id="header-text">
<h1 id="site-title">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
</h1>
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2><!-- #site-description -->
</div><!-- #header-text -->
<?php
}
?>
</div><!-- #header-left-section -->
<div id="header-right-section">
<?php
if( is_active_sidebar( 'spacious_header_sidebar' ) ) {
?>
<div id="header-right-sidebar" class="clearfix">
<?php
// Calling the header sidebar if it exists.
if ( !dynamic_sidebar( 'spacious_header_sidebar' ) ):
endif;
?>
</div>
<?php
}
?>
<nav id="site-navigation" class="main-navigation" role="navigation">
<h1 class="menu-toggle"><?php _e( 'Menu', 'spacious' ); ?></h1>
<?php
if ( has_nav_menu( 'primary' ) ) {
wp_nav_menu( array( 'theme_location' => 'primary' ) );
}
else {
wp_page_menu();
}
?>
</nav>
</div><!-- #header-right-section -->
</div><!-- #header-text-nav-wrap -->
</div><!-- .inner-wrap -->
</div><!-- #header-text-nav-container -->
<?php if( of_get_option( 'spacious_header_image_position', 'above' ) == 'below' ) { spacious_render_header_image(); } ?>
<?php
if( of_get_option( 'spacious_activate_slider', '0' ) == '1' ) {
if ( ( of_get_option( 'spacious_slider_status', 'home_front_page' ) == 'all_page' ) || ( ( is_home() || is_front_page() ) && of_get_option( 'spacious_slider_status', 'home_front_page' ) == 'home_front_page' ) ) {
spacious_pass_slider_parameters();
spacious_featured_image_slider();
}
}
if( ( '' != spacious_header_title() ) && !( is_home() || is_front_page() ) ) {
?>
<div class="header-post-title-container clearfix">
<div class="inner-wrap">
<div class="post-title-wrapper">
<?php
if( '' != spacious_header_title() ) {
?>
<h1 class="header-post-title-class">
<?php echo spacious_header_title(); ?>
<?php if ( function_exists( 'the_subtitle' ) ) { ?>
<span class="entry-subtitle">
<?php echo get_the_subtitle(); ?>
</span>
<?php } ?>
</h1>
<?php
}
?>
</div>
<?php if( function_exists( 'spacious_breadcrumb' ) ) { spacious_breadcrumb(); } ?>
</div>
</div>
<?php
}
?>
</header>
<?php do_action( 'spacious_after_header' ); ?>
<?php do_action( 'spacious_before_main' ); ?>
<div id="main" class="clearfix">
<div class="inner-wrap">
Great. Give me an hour or so. Need my morning coffee first. On Aug 16, 2014 8:37 AM, "travelinboots" notifications@github.com wrote:
Sorry. UGH.
<?php /**
Theme Header Section for our theme.
- Displays all of the section and everything up till *
- @package https://github.com/package ThemeGrill
- @subpackage Spacious
@since https://github.com/since Spacious 1.0 */ ?> <!DOCTYPE html>
<?php /**
- Print the tag based on what is being viewed. / wp_title( '|', true, 'right' ); ?> 'header', 'depth' => -1 ) ); } ?>
</div> <?php } ?> <?php if( of_get_option( 'spacious_header_image_position', 'above' ) == 'above' ) { spacious_render_header_image(); } ?> <div id="header-text-nav-container"> <div class="inner-wrap"> <div id="header-text-nav-wrap" class="clearfix"> <div id="header-left-section"> <?php if( ( of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'both' || of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'logo_only' ) && of_get_option( 'spacious_header_logo_image', '' ) != '' ) { ?> <div id="header-logo-image"> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo of_get_option( 'spacious_header_logo_image', '' ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"></a> </div><!-- #header-logo-image --> <?php } if( of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'both' || of_get_option( 'spacious_show_header_logo_text', 'text_only' ) == 'text_only' ) { ?> <div id="header-text"> <h1 id="site-title"> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a> </h1> <h2 id="site-description"><?php bloginfo( 'description' ); ?></h2><!-- #site-description --> </div><!-- #header-text --> <?php } ?> </div><!-- #header-left-section --> <div id="header-right-section"> <?php if( is_active_sidebar( 'spacious_header_sidebar' ) ) { ?> <div id="header-right-sidebar" class="clearfix"> <?php // Calling the header sidebar if it exists. if ( !dynamic_sidebar( 'spacious_header_sidebar' ) ): endif; ?> </div> <?php } ?> <nav id="site-navigation" class="main-navigation" role="navigation"> <h1 class="menu-toggle"><?php _e( 'Menu', 'spacious' ); ?></h1> <?php if ( has_nav_menu( 'primary' ) ) { wp_nav_menu( array( 'theme_location' => 'primary' ) ); } else { wp_page_menu(); } ?> </nav> </div><!-- #header-right-section --> </div><!-- #header-text-nav-wrap --> </div><!-- .inner-wrap --> </div><!-- #header-text-nav-container --> <?php if( of_get_option( 'spacious_header_image_position', 'above' ) == 'below' ) { spacious_render_header_image(); } ?> <?php
if( of_get_option( 'spacious_activate_slider', '0' ) == '1' ) { if ( ( of_get_option( 'spacious_slider_status', 'home_front_page' ) == 'all_page' ) || ( ( is_home() || is_front_page() ) && of_get_option( 'spacious_slider_status', 'home_front_page' ) == 'home_front_page' ) ) { spacious_pass_slider_parameters(); spacious_featured_image_slider(); } }
if( ( '' != spacious_header_title() ) && !( is_home() || is_front_page() ) ) { ?> <div class="header-post-title-container clearfix"> <div class="inner-wrap"> <div class="post-title-wrapper"> <?php if( '' != spacious_header_title() ) { ?> <h1 class="header-post-title-class">
<?php echo spacious_header_title(); ?> <?php if ( function_exists( 'the_subtitle' ) ) { ?> <?php echo get_the_subtitle(); ?> <?php } ?>
<?php } ?>
<?php if( function_exists( 'spacious_breadcrumb' ) ) { spacious_breadcrumb(); } ?>
<?php } ?>
<?php do_action( 'spacious_after_header' ); ?> <?php do_action( 'spacious_before_main' ); ?>
— Reply to this email directly or view it on GitHub https://github.com/philiparthurmoore/Subtitles/issues/25#issuecomment-52378552 .
please relax and have a coffee first ;-)
My internet has been dead all morning. Seems to be common on weekends in Hanoi. I'll look at this as soon as it's back on.
Thank you Philip. I'll stand by here. Enjoy your weekend!
That's a bug in your theme. My hunch is that the theme author isn't using the_title
correctly for attributes, which should only be called by the_title_attribute
. Can you post your index.php
file? I'm not sure if that's the right file or if the code is in a content part, but you should do a search for the_title
in your files and if you see that being used in title attributes, you should change it to the_title_attribute
. Let me know what you find.
Hello philip, there's nothing in the index.php that shows the_title_attirbute.
I found this code instead from the content-blog-full-content.php that has it:
UGH the code isn't showing here
When you post code, put it inside of three backticks and close it with three backticks.
<?php
/**
* The template used for displaying blog post full content.
*
* @package ThemeGrill
* @subpackage Spacious
* @since Spacious 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php do_action( 'spacious_before_post_content' ); ?>
<header class="entry-header">
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute();?>"><?php the_title(); ?></a>
</h1><!-- .entry-title -->
</header>
<div class="entry-content clearfix">
<?php
the_content();
wp_link_pages( array(
'before' => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Pages:', 'spacious' ),
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>'
) );
?>
</div>
<footer class="entry-meta-bar clearfix">
<div class="entry-meta clearfix">
<span class="by-author"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a></span>
<span class="date"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( get_the_time() ); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a></span>
<?php if( has_category() ) { ?>
<span class="category"><?php the_category(', '); ?></span>
<?php } ?>
<?php if ( comments_open() ) { ?>
<span class="comments"><?php comments_popup_link( __( 'No Comments', 'spacious' ), __( '1 Comment', 'spacious' ), __( '% Comments', 'spacious' ), '', __( 'Comments Off', 'spacious' ) ); ?></span>
<?php } ?>
<?php edit_post_link( __( 'Edit', 'spacious' ), '<span class="edit-link">', '</span>' ); ?>
</div>
</footer>
<?php
do_action( 'spacious_after_post_content' );
?>
</article>
Hm. Do you have a file with the string post-featured-image
inside of it? If so, post that code here.
When you post your code, do three backticks, the string php
, and make sure the code is under and above the backticks. That's how to make it look good in this thread.
<?php
/**
* The template used for displaying blog image large post.
*
* @package ThemeGrill
* @subpackage Spacious
* @since Spacious 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php do_action( 'spacious_before_post_content' ); ?>
<header class="entry-header">
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute();?>"><?php the_title(); ?></a>
</h1><!-- .entry-title -->
</header>
<?php
if( has_post_thumbnail() ) {
if( of_get_option( 'spacious_site_layout', 'box_1218px' ) == 'box_1218px' || of_get_option( 'spacious_site_layout', 'box_1218px' ) == 'wide_1218px' ) {
$featured = 'featured-blog-large';
}
elseif( of_get_option( 'spacious_site_layout', 'box_1218px' ) == 'box_978px' || of_get_option( 'spacious_site_layout', 'box_1218px' ) == 'wide_978px' ) {
$featured = 'featured';
}
$image = '';
$title_attribute = get_the_title( $post->ID );
$image .= '<figure class="post-featured-image">';
$image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">';
$image .= get_the_post_thumbnail( $post->ID, $featured, array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>';
$image .= '</figure>';
echo $image;
}
?>
<div class="entry-content clearfix">
<?php
the_excerpt();
?>
</div>
<footer class="entry-meta-bar clearfix">
<div class="entry-meta clearfix">
<span class="by-author"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author(); ?></a></span>
<span class="date"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( get_the_time() ); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a></span>
<?php if( has_category() ) { ?>
<span class="category"><?php the_category(', '); ?></span>
<?php } ?>
<?php if ( comments_open() ) { ?>
<span class="comments"><?php comments_popup_link( __( 'No Comments', 'spacious' ), __( '1 Comment', 'spacious' ), __( '% Comments', 'spacious' ), '', __( 'Comments Off', 'spacious' ) ); ?></span>
<?php } ?>
<?php edit_post_link( __( 'Edit', 'spacious' ), '<span class="edit-link">', '</span>' ); ?>
<span class="read-more-link"><a class="read-more" href="<?php the_permalink(); ?>"><?php echo of_get_option( 'spacious_read_more_text', __( 'Read more', 'spacious' ) ); ?></a></span>
</div>
</footer>
<?php
do_action( 'spacious_after_post_content' );
?>
</article>
This is wrong:
$image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">';
the_title( '', '', false )
should be the_title_attribute()
. Maybe alert the theme author about that bug also.
Changed it it works! There's a lot of bug in this theme ugh. not to mention I paid for it :-1: Thank you for your help. My problem now is that it's showing two titles which I am trying to figure out how to remove the second one.
No worries. It's annoying; paid stuff shouldn't have a ton of bugs. :smile:
Where are you seeing two titles?
Same page. http://www.travelinboots.com/blog/ Look at the Titles. There are two. One of top with link and the other one isn't linked. It's just a text which is very annoying and I want to remove
I think this has to do with the changed made to $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">';
. Please post the changes you made on that line.
it looks like this now:
$image .= '<a href="' . get_permalink() . '" title="'.the_title_attribute().'">';
K. That looks fine.
This is wrong: $title_attribute = get_the_title( $post->ID );
. Title attribute should never use title functions not intended for attributes. The theme author should change that to use the_title_attribute
with Post ID as an accepted argument. See this for more information. I suggest reporting that to the author as a bug.
In the meantime, you can remove this:
, array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) )
That should fix it.
Thank you Philip! I just remove that line but the two titles are still there. But please bother, I'll just contact the Theme Author about this. Thank you very much ;-)
:smile: Okie dokie. Let me know how it goes. I want to make 100% sure that Subtitles isn't breaking anything and the only thing that it ever touches is the_title
via a filter, so if double titles show up and markup is appearing where it shouldn't show up, then it's either a bug in the theme you're using or Subtitles is hooking into the_title
in a place where it shouldn't happen. I've found the former to be the prevailing reason. Hope you get it sorted out; let me know!
Will do! Thank you again!
I am using Spacious Pro by Theme Grill. I already installed the plugin and added subtitles in two of my latest posts but they are not showing on the theme.
The URL of my blog is http://www.travelinboots.com/ Specific postss not showing the Subtitles are: An Eerie Wander Through The Forest of Kanmangafuchi Abyss A Journey To The World Heritage of Nikko And It’s Magical
I need help on this, if there's something I can do to edit the code, please let me know.