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*

Reply To: How do I display the featured image on a page?

#28161

Hi dave69,

1) If I turn of comments in setting that turns it off for all pages AND posts. There should be away to remove the comments form from pages (not posts) site wide. With normal themes, you would simply remove from the pages template. With a theme such as Genesis, you would use a hook to do so.

=> To disable comment in every page only then there is only two options. Either you need to do manually from admin for each and every single page or you need code customization.

The file is inside theme folder -> inc -> structure -> content-extension.php on line no 201 to 261.

You may remove this code which is on line no 240 comments_template();

Hope this may help you

2) I’ve seen that page, and followed the advice. It either didn’t work or gave me an error. Can you show me the EXACT code I would need to add to have a custom “content-extensions.php” in the child theme?
==> To overide the default content-extension.php you need to create a child theme with style.css and functions.php file.

Under functions.php file you need to customize the code. First you need to unhook the functions and then customize the code.
Below i have added some code. Hope this may help you

Example:
// Unhook default Thematic functions
function unhook_thematic_functions() {
    // Don't forget the position number if the original function has one

remove_action( 'interface_loop_content', 'interface_theloop', 10 );

}
add_action('init','unhook_thematic_functions'); 

add_action( 'interface_loop_content', 'interface_theloop_child', 10 );

function interface_theloop_child() {
	if( is_page() ) {
		if( is_page_template( 'page-templates/page-template-blog-image-large.php' ) ) {
			
			interface_theloop_for_template_blog_image_large();
			
		}
		elseif( is_page_template( 'page-templates/page-template-blog-image-medium.php' ) ) {
			interface_theloop_for_template_blog_image_medium();
		}
		elseif( is_page_template( 'page-templates/page-template-blog-full-content.php' ) ) {
			
			interface_theloop_for_template_blog_full_content();
			
		}
		else {
			interface_theloop_for_page();
		}
	}
	elseif( is_single() ) {
		interface_theloop_for_single();
	}
	elseif( is_search() ) {
		interface_theloop_for_search();
	}
	else {
		interface_theloop_for_archive();
	}
}

// If you like to remove the comment sections from page only then paste this functions
//Important: Add other functions also where you don't want changing too. Because you have removed all the core functions using remove_action functions. So if there is no change in archive and other functions like interface_theloop_for_archive(), interface_theloop_for_search(), interface_theloop_for_single() then you copy all the code for this functions too. Just i have done for interface_theloop_for_page() too

/****************************************************************************************/

if ( ! function_exists( 'interface_theloop_for_page' ) ) :
/**
 * Fuction to show the page content.
 */
function interface_theloop_for_page() {
	global $post;

	if( have_posts() ) {
		while( have_posts() ) {
			the_post();

			do_action( 'interface_before_post' );
?>
<section id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  <article>
    <?php do_action( 'interface_before_post_header' ); ?>
    <?php do_action( 'interface_after_post_header' ); ?>
    <?php do_action( 'interface_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:', 'interface' ),
						'after'             => '</div>',
						'link_before'       => '<span>',
						'link_after'        => '</span>',
						'pagelink'          => '%',
						'echo'              => 1 
               ) );
    			?>
    </div>
    <!-- entry-content clearfix-->
    
    <?php 

  			do_action( 'interface_after_post_content' );

  			do_action( 'interface_before_comments_template' ); 

         do_action ( 'interface_after_comments_template' );

         ?>
  </article>
</section>
<?php
			do_action( 'interface_after_post' );

		}
	}
	else {
		?>
<h2 class="entry-title">
  <?php _e( 'No Posts Found.', 'interface' ); ?>
</h2>
<?php
   }
}
endif;

If you are still unable then you need to hire a developer

Thank you!