WordPress.org

Ready to get started?Download WordPress

Forums

Creating home page (CMS) and getting rid of title (11 posts)

  1. csteed
    Member
    Posted 4 years ago #

    Hi everyone

    I have created a home page - I am using WP as a CMS - and I want to know if (and how) I can get rid of the title on the page so that the page is just a photo and text:

    Home
    posted by Colin Steed
    September 6, 2009

    Hope it's possible and you have a solution

    Colin

  2. jonradio
    Member
    Posted 4 years ago #

    Go into your theme's folder and create a copy (perhaps with a name like home.php) of the page.php file with the following line removed:
    <h2><?php the_title(); ?></h2>

    Then Edit your Home Page with WordPress and change the Template to home.php

  3. csteed
    Member
    Posted 4 years ago #

    Thanks adiant. I cannot find the line to change:

    <?php get_header(); ?>
    <div class="column-center">
        <div class="indent-center">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
            <div class="title">
                <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
                <div class="author">
                   posted by <?php the_author(); ?>
                </div>
                <div class="date">
                     <?php tm_date('');?>
                </div>
            </div>
            <div class="text-box">
    			<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
                <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
            </div>
    		<?php endwhile; endif; ?>
        </div>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  4. ryans149
    Member
    Posted 4 years ago #

    Do you want to remove the title of blog itself ? or just a page ?

    1) For blog itself:

    open header.php and remove the link for home.. something like bloginfo tag

    2) For a page, remove this link:

    <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
  5. Adam Harley
    Member
    Posted 4 years ago #

    @csteed Are you using a static page for your homepage or a blog post?

  6. csteed
    Member
    Posted 4 years ago #

    Thanks all - have removed line but now I cannot change the template to home.php. On Quick Edit it only has Default Template on dropdown. Sorry if I am being thick here!

  7. Adam Harley
    Member
    Posted 4 years ago #

    Okay, reading over what's been suggested, that's not necessarily the best way to do it if you're not comfortable creating new files. Could you post the contents of your page.php file? If you're using a page, that's the file you need to change. Add the line back that you took out too if you can, and if that's from index.php, put it back permanently unless you want your homepage to be a series of blog posts, in which case just post index.php instead of page.php here. That make sense? :P

  8. csteed
    Member
    Posted 4 years ago #

    Here is my page.php

    <?php get_header(); ?>
    <div class="column-center">
        <div class="indent-center">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
            <div class="title">
                <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
                <div class="author">
                   posted by <?php the_author(); ?>
                </div>
                <div class="date">
                     <?php tm_date('');?>
                </div>
            </div>
            <div class="text-box">
    			<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
                <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
            </div>
    		<?php endwhile; endif; ?>
        </div>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Thanks very much for your help!

  9. Adam Harley
    Member
    Posted 4 years ago #

    Wow it really does have a permanent link part in pages. That's... different. Anyway, you can use:

    <?php get_header(); ?>
    <div class="column-center">
        <div class="indent-center">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<? if (  !is_front_page() ) : ?>
            <div class="title">
                <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
                <div class="author">
                   posted by <?php the_author(); ?>
                </div>
                <div class="date">
                     <?php tm_date(''); ?>
                </div>
            </div>
    		<? endif; ?>
            <div class="text-box">
    			<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
                <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
            </div>
    		<?php endwhile; endif; ?>
        </div>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    or if you want to be able to set it per-page, change !is_front_page() to !get_post_meta($id,'no_title',true) and put the custom field 'no_title' with the value '1' in every page you want to turn titles off for.

  10. csteed
    Member
    Posted 4 years ago #

    Thanks. Just to ensure I do this right. Do I replace the code above for the code I currently have for the page.php file?

  11. Adam Harley
    Member
    Posted 4 years ago #

    Yep

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.