September 30, 2013 at 8:00 am
#4286
Sanjip Shah
Participant
@Petrichor Making this file wp-content/themes/attitude-pro-child/library/structure/content-extensions.php is a wrong approach.
Making the same file name in the child theme will not overwrite the parent file so it has no meaning (as it is not a template but a fucntion extension file) and is wrong. Create the functions.php file in the child theme and paste the following code. That’s it.
<?php
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;
}
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' ); ?>
<?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
}
}
?>