Wordpress as CMS - How To Keep Main Page ?

Discussion in 'WordPress' started by WebWriter, Jan 25, 2006.

  1. #1
    I am trying to use wordpress as a basic CMS.

    I currently have it set to only show 1 blog at a time on the homepage but how do I get the front page stay the same no matter how many articles I add?

    For example, http://www.nowwerecookin.org/ uses wordpress but the main page has an intro that I am sure doesn't change whenever they add a new content item. That is what I want to do.

    Does that make sense?

    Thanks.
     
    WebWriter, Jan 25, 2006 IP
  2. kaptain

    kaptain Peon

    Messages:
    194
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    A couple versions ago it was easy with a pluin called Sticky. But, as far as i know the developer of that plugin has not kept it up to date.

    So, I made a template named "home" with the content that i wanted to stay the same. If you already have a template named "home" then the only thing you need to do is edit it.

    If you do this make sure you also have the other template sets that word press looks for. You should read this to understand the way the template system work. http://codex.wordpress.org/Template_Hierarchy
     
    kaptain, Jan 25, 2006 IP
  3. LadyJade

    LadyJade Peon

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the link because I've been jumping around looking for more 'techie' info on Word Press too.
     
    LadyJade, Jan 26, 2006 IP
  4. SEbasic

    SEbasic Peon

    Messages:
    6,317
    Likes Received:
    318
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The easiest way is to hard code whatever you want into the index page template...
     
    SEbasic, Jan 26, 2006 IP
  5. Hon Daddy Dad

    Hon Daddy Dad Peon

    Messages:
    1,041
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    0
    #5
    These easiest way is to create a category and then make that the only category that appears on the front page.

    So you could have a category called 'Front Page'

    In the index.php file of the theme you're working in put this code before the start of the loop:

    
    
    <?php query_posts('category_name=Front Page'); ?>
    
    
    HTML:
     
    Hon Daddy Dad, Jan 26, 2006 IP
  6. Nascar1

    Nascar1 Peon

    Messages:
    64
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Well I don't know if this is the easiest way but I just use this plugin and it works fine.

    http://www.semiologic.com/software/static-front/
     
    Nascar1, Jan 26, 2006 IP
  7. kaptain

    kaptain Peon

    Messages:
    194
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yea, I forgot about that one....

    Also you can name a content page index and make you domain "http://www.yoursite.com/index.html or php
     
    kaptain, Jan 26, 2006 IP
  8. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Place the following in your index template where you want the text to show:

    <?PHP if ($_GET[paged] =="" ) { ?>
    
      ...  your text here
    
    <?PHP } ?>
    Code (markup):
     
    ServerUnion, Jan 26, 2006 IP
  9. WebWriter

    WebWriter Active Member

    Messages:
    242
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #9
    Thank you guys so much. I spent so much time playing around with it yesterday because I thought it was obvious.

    I tried both CODE suggestions and there were a few small problems.

    When I tried
    <?PHP if ($_GET[paged] =="" ) { ?>
    
      ...  your text here
    
    <?PHP } ?>
    Code (markup):
    the other blogs remained.

    When I tried making a category and inserting the code, the entire sidebar disappeared.


    So where would I put the code? Here is my index.php

    Thank you.

    
    <?php get_header(); ?>
    
    	<div id="content" class="narrowcolumn">
    	<?php if (have_posts()) : ?>
    		
    		<?php while (have_posts()) : the_post(); ?>
    				
    			<div class="post">
    				<h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    				<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
    				<div class="entry">
    					<?php the_content('Read the rest of this entry &raquo;'); ?>
    				</div>
    		
    				<p class="postmetadata">Posted in <?php the_category(', ') ?> <strong>|</strong> <?php edit_post_link('Edit','','<strong>|</strong>'); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> 
    				
    				<!--
    				<?php trackback_rdf(); ?>
    				-->
    			</div>
    	
    		<?php endwhile; ?>
    
    		<div class="navigation">
    			<div class="alignleft"><?php posts_nav_link('','','&laquo; Previous Entries') ?></div>
    			<div class="alignright"><?php posts_nav_link('','Next Entries &raquo;','') ?></div>
    		</div>
    		
    	<?php else : ?>
    		<h2 class="center">Not Found</h2>
    		<p class="center"><?php _e("Sorry, but you are looking for something that isn't here."); ?></p>
    		<?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    	<?php endif; ?>
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
    
    
    
    Code (markup):
     
    WebWriter, Jan 26, 2006 IP
  10. kaptain

    kaptain Peon

    Messages:
    194
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #10
    just after this

    <?php get_header(); ?>

    <div id="content" class="narrowcolumn">

    But, you will want to keep the index.php as is and creat a file named home.php with the new text and existing index.php code.

    I hope that makes since

    By having a template named home.php, the extra text will only be on your home page.



     
    kaptain, Jan 26, 2006 IP
  11. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I would try to place it after this line:

     
    ServerUnion, Jan 26, 2006 IP
  12. fsmedia

    fsmedia Prominent Member

    Messages:
    5,163
    Likes Received:
    262
    Best Answers:
    0
    Trophy Points:
    390
    #12
    If your'e running Wordpress 2.0, the easiest thing you will be able to do then is create a home.php. This file will act as your index or home. index.php will be anything other which has not been specifically created (ie archive.php, single.php, category.php, etc etc).

    See here for further information: http://codex.wordpress.org/Using_Themes
     
    fsmedia, Jan 26, 2006 IP
  13. WebWriter

    WebWriter Active Member

    Messages:
    242
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #13
    Thanks guys. I appreciate it.
     
    WebWriter, Jan 26, 2006 IP
  14. LadyJade

    LadyJade Peon

    Messages:
    16
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I haven't tried any of the suggestions yet, I just popped back up to see new posts tonight but tomorrow I'll be playing! Previously I had only played with simple codes on blogs at blogger.com (free play!) before I jumped into Word Press.

    Thanks again for posting all of this info, we should name this thread "Word Press Tutorial: In Layman's Terms" ... if I ever learn this crap I will write about it! LOL

    :) Lisa
     
    LadyJade, Jan 26, 2006 IP
  15. Dreamshop

    Dreamshop Peon

    Messages:
    1,026
    Likes Received:
    84
    Best Answers:
    0
    Trophy Points:
    0
    #15
    LOL

    I do web development for a living and I often feel the same way. Sometimes programmers forget that regular people don't speak the same language. I find most software tutorials leave out the simplest things. ;)

    I'm testing Drupal for a larger site and dealing with a who other learning curce. Uh hello, yea you...oh glorious programmer...um, somes of us might like to change the text on our home page when we first install your script. Ever think about creating a tutorial that actuall tells me how to do that? And, sorry...but I don't really know quite yet what the all powerful aggregator does, or who's managing access control (beam me up Scotty), or how to fondle your nodes . I'd just want to update some page text.

    Please take us little people into consideration. Thanks!
     
    Dreamshop, Jan 26, 2006 IP
  16. kniveswood

    kniveswood Well-Known Member

    Messages:
    764
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    120