WordPress.org

Ready to get started?Download WordPress

Forums

Editing Code to Remove Unwanted Detail from Posts (6 posts)

  1. Bill Smith
    Member
    Posted 4 years ago #

    Hi there

    I would like to remove two bits of unnecessary info from the posts on my WP site.

    http://gumdiseaseremedies.com/oramd-ingredients-heres-the-recipe/

    1) The links that refer to other posts - situated at the top of the post between the header and the title.

    2) The blue/gray section at the foot of the post containing 4 lines of details about post/date/time/etc.

    I guess I need to take out some code from single.php - but would really appreciate some guidance.

    Here is the single.php code:

    +++++++QUOTE+++++++

    <?php get_header(); ?>

    <div id="content" class="<?php blueberry_sidebar(); ?>">

    <?php if ( have_posts() ) { while ( have_posts() ) { the_post(); ?>

    <div class="navigation">
    <div class="alignleft"><?php previous_post_link('« %link') ?></div>
    <div class="alignright"><?php next_post_link('%link »') ?></div>
    </div>
    <div class="post" id="post-<?php the_ID(); ?>">
    <h2><?php the_title(); ?></h2>
    <div class="entry">
    <?php
    the_content('<p>Continue reading ' . the_title('', '', false) . ' »</p>');
    wp_link_pages(
    array('before' => '<p>Pages: ',
    'after' => '</p>',
    'next_or_number' => 'number'
    )
    );
    ?>
    </div><!-- .entry -->
    <p class="postmeta center">
    " title="<?php the_title(); ?>" rel="bookmark">
    <?php the_title(); ?>
    was posted on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>.
    This post is tagged <?php the_tags('', ', ', ''); ?> and is filed under <?php the_category(', '); ?>.
    You can follow the replies through the <?php post_comments_feed_link('comments feed'); ?>.
    <?php blueberry_response(); ?>
    </p>
    </div><!-- .post #post-<?php the_ID(); ?> -->

    <?php } } else { ?>

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

    <?php } ?>

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

    <?php comments_template(); ?>

    <?php endwhile; else: ?>

    <p>Sorry, no posts matched your criteria.</p>

    <?php endif; ?>

    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    +++++++UNQUOTE+++++++

    If anyone can kindly help that will be much appreciated.

    Many thanks

    Bill Smith

  2. tugbucket
    Member
    Posted 4 years ago #

    <?php get_header(); ?>
    
    <div id="content" class="<?php blueberry_sidebar(); ?>">
    
    <?php if ( have_posts() ) { while ( have_posts() ) { the_post(); ?>
    
    <div class="post" id="post-<?php the_ID(); ?>">
    <h2><?php the_title(); ?></h2>
    <div class="entry">
    <?php
    the_content('<p>Continue reading ' . the_title('', '', false) . ' »</p>');
    wp_link_pages(
    array('before' => '<p>Pages: ',
    'after' => '</p>',
    'next_or_number' => 'number'
    )
    );
    ?>
    </div><!-- .entry -->
    
    </div><!-- .post #post-<?php the_ID(); ?> -->
    
    <?php } } else { ?>
    
    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.</p>
    
    <?php } ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <?php comments_template(); ?>
    
    <?php endwhile; else: ?>
    
    <p>Sorry, no posts matched your criteria.</p>
    
    <?php endif; ?>
    
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  3. esmi
    Forum Moderator
    Posted 4 years ago #

    1. Try editing single.php and removing:

    <div class="navigation">
    <div class="alignleft"><?php previous_post_link('« %link') ?></div>
    <div class="alignright"><?php next_post_link('%link »') ?></div>
    </div>

    2. Try editing single.php and removing:

    <p class="postmeta center">
    " title="<?php the_title(); ?>" rel="bookmark">
    <?php the_title(); ?> was posted on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>.
    This post is tagged <?php the_tags('', ', ', ''); ?> and is filed under <?php the_category(', '); ?>.
    You can follow the replies through the <?php post_comments_feed_link('comments feed'); ?>.
    <?php blueberry_response(); ?>
    </p>
    </div>
  4. Bill Smith
    Member
    Posted 4 years ago #

    Ooops !

    That seems to remove a bit too much.

    All the page style is also removed and the contents are spread across the page.

    As you can see here:

    http://gumdiseaseremedies.com/oramd-ingredients-heres-the-recipe/

    Kind regards

    Bill Smith

  5. Bill Smith
    Member
    Posted 4 years ago #

    OK - that answer I gave was to tugbucket . . .

    I'll try esmi's suggestion.

    Thanks for your suggestions . . .

    Kind regards

    Bill Smith

  6. Bill Smith
    Member
    Posted 4 years ago #

    Hi esmi

    The first suggestion worked a treat. It took away the anchor text as planned.

    Thanks for that.

    The second one seems to remove a lot of the page setup as well as the 4 lines of text - so I had to reinstate the original code.

    Still - 50% was good !!

    Thanks a lot for your ideas.

Topic Closed

This topic has been closed to new replies.

About this Topic