Quantcast
Channel: Site5 Free Premium WordPress Themes » All Posts
Viewing all articles
Browse latest Browse all 8865

Page Title and Date/Comment Removal

$
0
0

If you are using your site as a static page site and have no need for full blog functionality (the blog and posts will still work after this, mind you), then do the following steps. There have been numerous posts on this topic and a lot of misinformation from other posters (Guido consistently gives some of the information but not all), so I thought I’d clear the air on this topic once and for all.

!!! AS ALWAYS, MAKE BACKUPS OF ORIGINAL THEME FILES PRIOR TO EDITING. !!!

Files you need to edit:
- template.page.fullwidth.php (for Page Title & Date/Comment removal)
- index.php
- single.php
- page.php
- header.php (for removal of Title/Search Bar)

For removal of Page Title & Date/Comment:

- In template.page.fullwidth.php, delete lines 10-25
- For posterity sake in case of theme updates…removal of lines 10-25 will delete the following code

<header class="clearfix">				
	<ul class="meta">
		<li><?php echo get_the_date("M d / Y"); ?></li>
		<li><span class="comments"><?php comments_number('0','1','%'); ?> </span></li>
	</ul>
</header>

<?php if(has_post_thumbnail()): the_post_thumbnail('thumbnail', array('class'=>'blog-thumb')); ?><?php endif; ?>
	<div class="blog-entry">

		<span class="categories"><?php the_category(', '); ?></span>
			<h2 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
	</div>

- In index.php, delete lines 5-65
- For posterity sake in case of theme updates…removal of lines 5-65 will delete the following code

<?php
	// WP 3.0 PAGED BUG FIX
	if ( get_query_var('paged') )
	$paged = get_query_var('paged');
	elseif ( get_query_var('page') )
	$paged = get_query_var('page');
	else
	$paged = 1;

	$args = array(
	'post_type' => 'post',
	'paged' => $paged );

	query_posts($args);
	?>
	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

	<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
		<header class="clearfix">				
			<ul class="meta">
				<li><?php echo get_the_date("M d / Y"); ?></li>
				<li><span class="comments"><?php comments_popup_link(__('0', 'site5framework'), __('1', 'site5framework'), __('%', 'site5framework')); ?> </span></li>
			</ul>
		</header>

		<?php if(has_post_thumbnail()): the_post_thumbnail('thumbnail', array('class'=>'blog-thumb')); ?><?php endif; ?>
		<div class="blog-entry">
			<span class="categories"><?php the_category(', '); ?></span>
			<h2 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
			<div id="post-content">
				<?php the_content(__("Continue Reading", "site5framework")); ?>
			</div>
		</div>

	</article>

	<?php endwhile; ?>
	<!-- begin #pagination -->
		<?php if (function_exists("emm_paginate")) { 
				emm_paginate();  
			 } else { ?>
		<div class="navigation">
	        <div class="alignleft"><?php next_posts_link('Older') ?></div>
	        <div class="alignright"><?php previous_posts_link('Newer') ?></div>
	    </div>
        <?php } ?>
        <!-- end #pagination -->
        <?php endif;?>

	<?php wp_reset_query(); ?>

- In single.php, delete lines 4-49
- For posterity sake in case of theme updates…removal of lines 4-49 will delete the following code

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
	<article>			
		<header class="clearfix">				
			<ul class="meta">
				<li><date><?php echo get_the_date("M d / Y"); ?></date></li>
				<li><span class="comments"><?php comments_popup_link(__('0', 'site5framework'), __('1', 'site5framework'), __('%', 'site5framework')); ?> </span></li>
				<li><span class="tags"><?php the_tags('') ?></a>
			</ul>
		</header>

		<?php if(has_post_thumbnail()): the_post_thumbnail('thumbnail', array('class'=>'blog-thumb')); ?><?php endif; ?>

		<div class="blog-entry">
			<span class="categories"><?php the_category(', '); ?></span>
			<h2 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
		</div>
		<span class="clearfix"></span>
		<?php the_content(); ?>
		<?php endwhile; ?>
		<?php comments_template(); ?>
	</article>
	<?php else: ?>
	<article>
		<div class="blog-entry">
			<h2 class="post-title"><?php _e("No Posts Yet", "site5framework"); ?></h2>
			<div id="post-content">
				<p><?php _e("Sorry, What you were looking for is not here.", "site5framework"); ?></p>
			</div>
		</div>
	</article>
	<?php endif; ?>

- In page.php, delete lines 4-46
- For posterity sake in case of theme updates…removal of lines 4-46 will delete the following code

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
	<article>
				
		<header class="clearfix">				
			<ul class="meta">
				<li><?php echo get_the_date("M d / Y"); ?></li>
				<li><span class="comments"><?php comments_popup_link(__('0', 'site5framework'), __('1', 'site5framework'), __('%', 'site5framework')); ?> </span></li>
			</ul>
		</header>
		<?php if(has_post_thumbnail()): the_post_thumbnail('thumbnail', array('class'=>'blog-thumb')); ?><?php endif; ?>
		<div class="blog-entry">
			<span class="categories"><?php the_category(', '); ?></span>
			<h2 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
		</div>
		<span class="clearfix"></span>
		<?php the_content(); ?>
		</article>
	<?php endwhile; ?>
	<?php else: ?>
	<article>
		<div class="blog-entry">
			<h2 class="post-title"><?php _e("No Posts Yet", "site5framework"); ?></h2>
			<div id="post-content">
				<p><?php _e("Sorry, What you were looking for is not here.", "site5framework"); ?></p>
			</div>
		</div>
	</article>
	<?php endif; ?>

For removal of Title/Search Bar:

- Delete lines 105-137
- For posterity sake in case of theme updates…removal of lines 105-137 will delete the following code

<div class="page-title">
    <div class="wrapper">
        <h2><?php 
      	if(is_home()) echo 'Blog'; 
      	else {
      	?>
		<?php if (is_category()) { ?>
			<?php _e("Posts Categorized", "site5framework"); ?> / <span><?php single_cat_title(); ?></span> 
		            <?php } elseif (is_tag()) { ?> 
			<?php _e("Posts Tagged", "site5framework"); ?> / <span><?php single_cat_title(); ?></span>
			    <?php } elseif (is_author()) { ?>
			<?php _e("Posts By", "site5framework"); ?> / <span><?php the_author_meta('display_name', $post->post_author) ?> </span> 
			    <?php } elseif (is_day()) { ?>
			<?php _e("Daily Archives", "site5framework"); ?> / <span><?php the_time('l, F j, Y'); ?></span>
			    <?php } elseif (is_month()) { ?>
		    	<?php _e("Monthly Archives", "site5framework"); ?> / <span><?php the_time('F Y'); ?></span>
			    <?php } elseif (is_year()) { ?>
		    	<?php _e("Yearly Archives", "site5framework"); ?> / <span><?php the_time('Y'); ?></span> 
			    <?php } elseif (is_Search()) { ?>
	        	<?php _e("Search Results", "site5framework"); ?> / <span><?php echo esc_attr(get_search_query()); ?></span> 
			    <?php } elseif (is_single() or is_page()) { ?>
				<?php the_title(); ?> 
			<?php } ?>
        	<?php
        } ?></h2>

    <form role="search" method="get" id="searchform" action="<?php bloginfo('url'); ?>" >					
	<input type="text" value="search" onfocus="this.value='';" name="s" id="s" />
	<input type="submit" id="searchsubmit" value="" />
    </form>	
    </div>
</div>
  • This topic was modified 10 hours, 5 minutes ago by  sytyguy.
  • This topic was modified 10 hours, 4 minutes ago by  sytyguy.
  • This topic was modified 10 hours, 3 minutes ago by  sytyguy.
  • This topic was modified 9 hours, 50 minutes ago by  sytyguy.

Viewing all articles
Browse latest Browse all 8865

Trending Articles