badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Put page title in the breadcrumbs bar

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #3744
    shawnhoffman
    Participant

    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.

    #3751
    Sanjip Shah
    Participant

    @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.

    #3800
    shawnhoffman
    Participant

    Okay- 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.

    #3803
    Sanjip Shah
    Participant

    @shawnhoffman Where did you paste this code. functions.php of the Child theme or the parent theme?

    #3805
    shawnhoffman
    Participant

    Of 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.

    #3819
    Sanjip Shah
    Participant

    @shawnhoffman You will have to edit this function as well. Just remove the title from this function.

    #3839
    shawnhoffman
    Participant

    I’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?

    #3863
    Sanjip Shah
    Participant

    @shawnhoffman It’s fine. 🙂

    #4165
    haegeman
    Participant

    Hi,

    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

    #4166
    haegeman
    Participant

    Sorry, it’s ok, I fond the content-extention.php.
    Have a nice day,
    Stéphane

    #4178
    Sanjip Shah
    Participant

    @haegeman Okay.

    #4211
    Petrichor
    Participant

    I’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?

    http://injestfestival.com/tickets/

    #4233
    Sanjip Shah
    Participant

    @Petrichor Please paste the code of your functions.php of child theme and I will look into it.

    #4250
    Petrichor
    Participant

    I 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;

    #4260
    Petrichor
    Participant

    What 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.

Viewing 15 posts - 1 through 15 (of 24 total)
  • You must be logged in to reply to this topic.