- This topic has 23 replies, 4 voices, and was last updated 11 years, 1 month ago by Sanjip Shah.
-
AuthorPosts
-
September 3, 2013 at 6:36 am #3744shawnhoffmanParticipant
I like the way the title goes into the darker grey bar for the blog, business page, contact page… actually it seems like every page except a standard “page”. An example is the ‘typography’ page of the attitude sample. Is there any way to have that title go into the dark grey area where the other titles are, instead of where it currently goes? I think it would look much nicer to fit with the others.
September 3, 2013 at 7:28 am #3751Sanjip ShahParticipant@shawnhoffman For the page templates other than default page template the titles will appear in the grey part and for the default page template title will appear in the content area. We have designed the theme this way to highlight the titles of unique page templates. You will have to customize this function attitude_header_title function. You could just add
elseif( is_page() ) { $attitude_header_title = get_the_title(); }
just below this code
elseif( is_page_template() ) { $attitude_header_title = get_the_title(); }
Also make a child theme to make this customization so that you won’t lose the changes when you update the theme.
September 5, 2013 at 4:14 am #3800shawnhoffmanParticipantOkay- So I put this in functions.php
if ( ! function_exists( 'attitude_header_title' ) ) : /** * Show the title in header * * @since Attitude 1.0 */ function attitude_header_title() { if( is_archive() ) { $attitude_header_title = single_cat_title( '', FALSE ); } elseif( is_404() ) { $attitude_header_title = __( 'Page NOT Found', 'attitude' ); } elseif( is_search() ) { $attitude_header_title = __( 'Search Results', 'attitude' ); } elseif( is_page_template() ) { $attitude_header_title = get_the_title(); } elseif( is_page() ) { $attitude_header_title = get_the_title(); } else { $attitude_header_title = ''; } return $attitude_header_title; } endif;
Was that more work that needed?
Also – can I take out the title now where it was previously? I want it only in the grey area, and not where it was previously. Now it is in both places.
September 5, 2013 at 7:37 am #3803Sanjip ShahParticipant@shawnhoffman Where did you paste this code. functions.php of the Child theme or the parent theme?
September 5, 2013 at 4:23 pm #3805shawnhoffmanParticipantOf the child theme- that is the best place to do it, right?
Now I just want to eliminate the old title, and only have the new one in the grey area.
September 6, 2013 at 8:20 am #3819Sanjip ShahParticipant@shawnhoffman You will have to edit this function as well. Just remove the title from this function.
September 6, 2013 at 9:36 pm #3839shawnhoffmanParticipantI’m sorry- which part do I need to remove? — I remove it from the above code?
It looks like the code in content-extensions.php
function attitude_theloop_for_page() { global $post; if( have_posts() ) { while( have_posts() ) { the_post(); do_action( 'attitude_before_post' ); ?> <section id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article> <?php do_action( 'attitude_before_post_header' ); ?> <header class="entry-header"> <h2 class="entry-title"> <?php the_title(); ?> </h2><!-- .entry-title --> </header> <?php do_action( 'attitude_after_post_header' ); ?> <?php do_action( 'attitude_before_post_content' ); ?> <div class="entry-content clearfix"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Pages:', 'attitude' ), 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', 'pagelink' => '%', 'echo' => 1 ) ); ?> </div> <?php do_action( 'attitude_after_post_content' ); do_action( 'attitude_before_comments_template' ); comments_template(); do_action ( 'attitude_after_comments_template' ); ?> </article> </section> <?php do_action( 'attitude_after_post' ); } } else { ?> <h1 class="entry-title"><?php _e( 'No Posts Found.', 'attitude' ); ?></h1> <?php } } endif;
So I just paste that code into functions.php of the child theme and remove:
<header class="entry-header"> <h2 class="entry-title"> <?php the_title(); ?> </h2><!-- .entry-title --> </header>
I think? Do I need to remove more? less? Or do I need to even include all of that code?
September 9, 2013 at 7:49 am #3863Sanjip ShahParticipant@shawnhoffman It’s fine. 🙂
September 24, 2013 at 7:33 pm #4165haegemanParticipantHi,
Thanks for all these explains.
I almost succeeded but do’nt find the place I have to go to remove the old H2.
Can you say me wich file I have to modify ?
Thanks a lot,
Stéphane
September 24, 2013 at 8:06 pm #4166haegemanParticipantSorry, it’s ok, I fond the content-extention.php.
Have a nice day,
StéphaneSeptember 25, 2013 at 7:35 am #4178Sanjip ShahParticipant@haegeman Okay.
September 26, 2013 at 9:58 am #4211PetrichorParticipantI’m using Attitude Pro. I added the above code to attitude-pro-child/../functions.php but the location of the page title/heading doesn’t change. Should I be adding anything additional, such as <?php ?> around the code snippet?
September 27, 2013 at 7:12 am #4233Sanjip ShahParticipant@Petrichor Please paste the code of your functions.php of child theme and I will look into it.
September 28, 2013 at 7:41 am #4250PetrichorParticipantI created wp-content/themes/attitude-pro-child/library/structure/content-extensions.php and removed the following lines:
<header class=”entry-header”>
<h2 class=”entry-title”>
” title=”<?php the_title_attribute();?>”><?php the_title(); ?>
</h2><!– .entry-title –>
</header>I created wp-content/themes/attitude-pro-child/functions.php and put the following script in it:
function attitude_theloop_for_page() {
global $post;if( have_posts() ) {
while( have_posts() ) {
the_post();do_action( ‘attitude_before_post’ );
?>
<section id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<article><?php do_action( ‘attitude_before_post_header’ ); ?>
<header class=”entry-header”>
<h2 class=”entry-title”>
<?php the_title(); ?>
</h2><!– .entry-title –>
</header><?php do_action( ‘attitude_after_post_header’ ); ?>
<?php do_action( ‘attitude_before_post_content’ ); ?>
<div class=”entry-content clearfix”>
<?php the_content(); ?>
<?php
wp_link_pages( array(
‘before’ => ‘<div style=”clear: both;”></div><div class=”pagination clearfix”>’.__( ‘Pages:’, ‘attitude’ ),
‘after’ => ‘</div>’,
‘link_before’ => ‘<span>’,
‘link_after’ => ‘</span>’,
‘pagelink’ => ‘%’,
‘echo’ => 1
) );
?>
</div><?php
do_action( ‘attitude_after_post_content’ );
do_action( ‘attitude_before_comments_template’ );
comments_template();
do_action ( ‘attitude_after_comments_template’ );
?>
</article>
</section>
<?php
do_action( ‘attitude_after_post’ );}
}
else {
?>
<h1 class=”entry-title”><?php _e( ‘No Posts Found.’, ‘attitude’ ); ?></h1>
<?php
}
}
endif;September 29, 2013 at 7:08 am #4260PetrichorParticipantWhat I don’t know is if the recommended edit on content-extensions.php should be the full file, minus those lines of code, placed in wp-content/themes/attitude-pro-child/library/structure/content-extensions.php, or if a new content-extensions.php file should be placed elsewhere.
Also, I don’t know if I should be adding the code from post #3839 to a blank functions.php file in the child folder, or if it should include additional code.
-
AuthorPosts
- You must be logged in to reply to this topic.