1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Is there a way not to show posts on Homepage of Wordpress?

Discussion in 'WordPress' started by alunsina, Feb 14, 2009.

  1. #1
    I want to show only the widgets like recent posts and featured, etc. Is there a way to do this?

    thanks!
     
    alunsina, Feb 14, 2009 IP
  2. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    405
    Best Answers:
    21
    Trophy Points:
    295
    #2
    Nigel Lew, Feb 14, 2009 IP
    alunsina likes this.
  3. alunsina

    alunsina Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for the reply.

    i dont wanna show a static page either. i want to use that space to show the widgets (recent posts, recent comments, etc.) only
     
    alunsina, Feb 14, 2009 IP
  4. scoopy82

    scoopy82 Active Member

    Messages:
    838
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    70
    #4
    You can use a "conditional tag" to customize what code gets displayed on which pages. Its all going to depend on the widgets and theme you are currently using and how they are coded... but it would go something like this:

    The current code producing the posts should look something like the following on page.php:
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<h2><?php the_title(); ?></h2>
    			<div class="entry">
    				<?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>
    		</div>
    		<?php endwhile; endif; ?>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    Code (markup):
    You will want to wrap that inside a condition tag so that your widgets display ONLY if home page... if not a home page... it will display the code after the "else" line:
    if (is_home()) {
            // PLACE WIDGET CODE HERE
    
    } else {
            // PLACE POST CODE IN THIS SPOT
    
    }
    Code (markup):
    More info on this is here:
    codex.wordpress.org/Conditional_Tags
     
    scoopy82, Feb 14, 2009 IP
    alunsina likes this.
  5. alunsina

    alunsina Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    wow! thanks a lot.

    will try to try this. :D
     
    alunsina, Feb 14, 2009 IP
  6. sriraj46

    sriraj46 Peon

    Messages:
    102
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Good if your question is answered but can't a recent posts plugin solve that?
     
    sriraj46, Feb 14, 2009 IP
  7. alunsina

    alunsina Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    it wont, actually. a recent post plugin is a recent post plugin. ;)
     
    alunsina, Feb 15, 2009 IP
  8. Web 2.0 Designer

    Web 2.0 Designer Peon

    Messages:
    67
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Haven't heard of conditional tags, looking into it now.. thanks.
     
    Web 2.0 Designer, Feb 15, 2009 IP
  9. Jalpari

    Jalpari Notable Member

    Messages:
    5,640
    Likes Received:
    137
    Best Answers:
    0
    Trophy Points:
    260
    #9
    create new page in wp and set as home page by going settings > reading > static page > select ur page.

    u can check my recipe blog is an example.
     
    Jalpari, Feb 15, 2009 IP
  10. alunsina

    alunsina Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    @jalpari. thanks but thats not what i mean.

    @scoopy82

    it worked! man, you're my hero.
     
    alunsina, Feb 17, 2009 IP