View Full Version : Remove Date/Author line from Pages but NOT Posts

02-23-2011, 06:40 PM

I'm new to WordPress/Socrates but I have web design experience.

First I found some information on this form with instructions on how to remove the code from the index.php to accomplish this. Supposedly if that line of code was not removed from the single.php file, the line would remain on the posts, but it does not. I removed that line of code from the index.php file and the date/author line at the top was gone from all pages AND posts.

Then I ended up finding the area in the Dashboard where I can select the option to remove this line of info, which is an easier way to go about it, but it still doesn't accomplish what I'm after.

At this point, I still have not figured out how to remove the date/author line from PAGES only and still have it present on POSTS. Please help!?

Thanks in advance!

Dan Nickerson
02-23-2011, 07:46 PM
You'll need to make a new page template and upload to your socrates directory then use it as the page template for your pages.

Try copying this into a new page named page.php



* Socrates Premium Theme for Wordpress

* (c) 2010 Flying Monkey Media, Inc.

* http://www.socratestheme.com

* Version 2.02.b7


* @File page.php
Template Name: No Page Title



include "topAd.php";

//include "sidebar.php";

//include "sidebar2.php";

$inpost1counter = 0;

$inpost2counter = 0;

$layout = get_option("layoutOptions");

if($layout['sidebar'] == 'styleBothSides.css') {

include "sidebar.php";



<div id="im-mainContent" class="im-mainContent">

<div id="post-" class="post">

<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>

<div <?php post_class() ?> id="post-<?php the_ID(); ?>">

<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<div class="entry">


$topAd = get_option("socratesOptions");

if(($topAd['inpostad1'] != '' && !is_page() && $inpost1counter<$topAd['inpostadmaxrepeat']) && !$custom_fields['_mcf_postDisableInPostAd'][0]) {

echo '<div id="socratesinpostad" style="float:'.$topAd['inpostposition'].'; display:block; padding:5px; margin:0;">'.stripslashes($topAd['inpostad1']).'</div>';




<?php the_content('Read the rest of this entry &raquo;'); ?>




if(($topAd['inpostad2'] != '' and !is_page() and $inpost2counter<$topAd['inpostad2maxrepeat']) && !$custom_fields['_mcf_postDisableInPostAd'][0]) {

echo '<div id="socratesinpostadbottom" style="clear: both; display: block;">'.stripslashes($topAd['inpostad2']).'</div><br>';




<div class="commentsFrame"><?php comments_template() ?></div>

<?php endwhile; ?>

<div class="navigation">

<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>

<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>


<?php else : ?>

<h2 class="center">Not Found</h2>

<p class="center">Sorry, but you are looking for something that isn't here.</p>

<?php get_search_form(); ?><br />

<?php $args = array(

'smallest' => 8,

'largest' => 22,

'unit' => 'pt',

'number' => 45,

'format' => 'flat',

'separator' => ', ',

'orderby' => 'name',

'order' => 'ASC',

'link' => 'view',

'taxonomy' => 'post_tag',

'echo' => true ); ?>

<?php wp_tag_cloud( $args ); ?>

<?php endif; ?>

</div><!-- /posts -->

</div><!-- /im-mainContent -->


if($layout['sidebar'] != 'styleBothSides.css') {

include "sidebar.php";


include "sidebar2.php";

<div class="line"></div>
<?php get_footer(); ?>

02-24-2011, 06:45 AM
Thank you! I was able to accomplish just what I needed to, but I ended up copying the code from the index.php page to the page.php page and just removing what I didn't want, is that OK or will that cause any other changes or problems anywhere?

Dan Nickerson
02-24-2011, 10:41 AM
That's exactly what I did so you're fine.