WordPress.org

Support

Support » Plugins and Hacks » Plugin: Static front page

Plugin: Static front page

Viewing 15 replies - 31 through 45 (of 70 total)
  • Here’s what I want to do:

    Have a home page with some static content, and a listing of recent posts within a certain category. I was hoping this plugin would address this need.

    I installed plugin, created a page called Home and associated with a template called home.php, which begins with what I understand to be the standard “The Loop” code. This results in the contents of my home “Page” being printed to the screen. Fine.

    My home.php template then contains some code like this:


    <php $my_query = new WP_Query('cat=2&showposts=5'); ?>
    <php while ($my_query->have_posts()) : $my_query->the_post(); ?>

    In other “pages”, this code will print a listing of posts within my cat_id 2 category. However, in *this* particular case, I’m simply geting a listing of a single “post” — my single Home “page” (i.e. I’m getting a repeat of the content printed at the top of the page.)

    Any ideas?

    Denis de Bernardy

    @denis-de-bernardy

    that won’t work, best I know, since the plugin filters the wp_query on the page detected as the home page. you could tweak it to allow it to be called only once, though. for a variety of reasons, I’d expect more bugs rather than less from that.

    why don’t you use your $my_query = new WP_Query() code twice? obviously, you know what you’re doing.

    It may *seem* that I know what I’m doing, but I guess I really don’t. 🙂 How would creating a second object solve the problem? Does the plugin only filter the first instance somehow? Thanks!

    Denis de Bernardy

    @denis-de-bernardy

    something like:

    $my_query = new WP_Query(‘relevant_params’);
    $my_query2 = new WP_Query(‘cat=2&showposts=5’);

    while ($my_query->have_posts())
    {
    $my_query->the_post();
    }
    while ($my_query2->have_posts())
    {
    $my_query2->the_post();
    }

    if you use the static front page plugin, the wp_query will get filtered and bypassed on the home page.

    I have a problem similar to makulu, and I’m not sure I understand the answer:

    I’m using a wordpress install as a recipe list site. In my sidebar, I included a quick list of all the recipes. My attempts went like this:

    1. Without sem-static-front I would just have my sidebar do a new query_posts(‘special stuff’) and a second wordpress loop. It worked great.

    2. When I installed the plugin, my list of posts (recipes) became just the static front page. [Both on the static home AND on other pages]

    3. I put this code in my sidebar:
    <?php $recipe_list_query = new WP_Query('showposts=-1&orderby=title&order=ASC');
    if ($recipe_list_query->have_posts()) : ?>
    <li id="list-posts"><?php _e('full recipe list:'); ?>
    <ul>
    <?php while ($recipe_list_query->have_posts()) : $recipe_list_query->the_post(); ?>
    <li><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
    <?php endwhile ?></ul>
    </li><?php endif; ?>

    This fixed all the other pages, but the static homepage still doesn’t show my recipe list. Is this a bug? Or am I still missing something?

    I class myself as a non-programmer, thus I would tend to look for a work-around.

    Can’t you just use your RSS feeds to output a nice title with excerpt?

    I am looking toward a work-around for this, but no the RSS feeds won’t help. I don’t want my feeds to have every entry in them, but I do want the sidebar list to be complete.

    I’ve run into a little problem using the plugin. On post pages only the link back to the home page incorporates the post title in the anchor text like this:

    <li class="page_item">Post Page Title - Home Page Title

    I’m using the “classic” template with these other plugins running:
    Customizable Post Listings
    Head META Description
    Rewrite Titles
    Solvent
    Striptease

    Thanks,
    patung

    Ok so I screwed up posting the code, here it is again:

    <* href=”/” title=”Home Page Title”>Post Page Title – Home Page Title</*>

    I have a question (sorry if this is answered already)…

    I’ve got the static page showing up at /index.php, and have set the home directory of my actual blog to be /jotter…

    But the static home page is showing up at both of these locations… can I make it only show up at /index.php?

    (/jotter should just be the normal homepage loop to list all the blog entries)

    UPDATE: FIXED using http://codex.wordpress.org/Pages#Making_your_blog_appear_in_a_non-root_folder

    A page of mine will normally show comments. But, once I make it the static home page, the comments disappear. Can this be fixed, or is there another static home page pluging that won’t do this?

    slobizman – the easiest solution to this is to make a copy of index.php and save it as home.php – the browsers will look for that before they look for index.php, and then you can have the regular comment setup, and make the other changes to your home page that way.

    you don’t need a plugin for a static home page…

    Problem is though, that I need the comments to show up with the post (page). I can’t have the user click the comments link first. The index.php won’t do that. That’s why I was trying to use the page rather than post.

    have you tried setting it up doing that with the home.php page? i’m not sure if there’s a difference or not, becuase i haven’t tried it, but i’d venture to guess that something resembling

    <?php include (TEMPLATEPATH . '/comments.php'); ?>

    in the proper place/div should work, shouldn’t it?

    Whoa…this is really strange.

    I deactivated this plugin and then installed Filosofo Home-Page Control. It worked and I entered some comments. Then, deciding I didn’t like how it forced the URL to me mydomain.com/home/ instead of just mydomain.com (liek Static Home Page pluging), I decativated it.

    Then I reactivated Static Page plugin and went back to my front page, and viola!!!! the comments where still there! So deleted them all, thinking maybe this plugin needed to have at least one comment on the page to work. but, even after removing all the comments, it still showed the comment box!

    I don’t know if the Filosofo plugin did something somewhere, or getting the comments in (even after deleting them) did something, but it’s working.

    I’m a litle afraid of it all though as the entire site design will rely on this to work all the time. To the plugin developer: could you please comment on this when you get a chance? I’d appreciate it. Thanks.

Viewing 15 replies - 31 through 45 (of 70 total)
  • The topic ‘Plugin: Static front page’ is closed to new replies.
Skip to toolbar