WordPress.org

Support

Support » How-To and Troubleshooting » Home Page with static info AND posts?

Home Page with static info AND posts?

  • Hello everyone,

    I’m looking for something similar to the issues raised in the thread (however it was resolved):
    http://wordpress.org/support/topic/123681
    [mod: every URL starts with http!]

    I want to have a static page with basic info of my site, along with a few (maybe 2 or 3 of the most recent) “news update posts” from a “site news” category I created, below it.

    (Maybe even hiding the “site news” category from my other categories list in my sidebar, however hiding it isn’t completely necessary for me.)

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Just hard code your stuff into index.php

    I’m not that good at “hard coding” (Although I will if I have to), I thought there may be some function in the option menu (or plugin) that may allow these sort of features.

    Will this plugin solve my problem?
    http://wordpress.org/extend/plugins/page2cat/

    Although it says it is for developers only.

    OK that last post looks a little off (and I can’t edit it), I’ll try entering it again:

    <?php
    $how_many=5; //How many posts do you want to show
    require_once("http://www.toptenlisted.com/wp-config.php"); // Change this for your path to wp-config.php file ?>
    <ol id="whats-new">
    <?
    $news=$wpdb->get_results("SELECT <code>ID</code>,<code>post_title</code> FROM $wpdb->posts
    WHERE <code>post_status</code>= \"publish\" ORDER BY 'ID' DESC LIMIT ".$how_many);
    foreach($news as $np){
    print ("<li><a href=\"");
    echo get_permalink($np->ID);
    print ("\">$np->post_title</a></li>");
    } ?>
    </ol>

    I would simply open index.php and just before the loop gets started – I would post in my static content. Below it come my posts. In admin set the number of posts shown to 3. No hackery needed.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Home Page with static info AND posts?’ is closed to new replies.
Skip to toolbar