WordPress.org

Ready to get started?Download WordPress

Forums

is_home in 2.1 not working (8 posts)

  1. mikeall
    Member
    Posted 7 years ago #

    I have this on my blogs but it ignores it now:

    <?php if ( is_home() ) { ?>
    <meta name="description" content="<?php bloginfo('name'); ?> - <?php bloginfo('description'); ?>" />
    <?php } ?>

    What's the issue?

  2. Kafkaesqui

    Posted 7 years ago #

    Are you using query_posts() somewhere in your template? Have you set your front page to display a 'static' Page?

    Basically, what is different about your setup?

  3. vanesta
    Member
    Posted 7 years ago #

    mine uses quert_posts on sidebar and my is_home on sidebar dies too

    i use

    query_posts("cat=1&showposts=5");
    while (have_posts()) : the_post(); {
    ?>

  4. " rel="bookmark" title="<?php printf(__('%s','k2_domain'), strip_tags(get_the_title())) ?>"><?php the_title(); ?>
  5. <?php /* End Asides Loop */ } endwhile; ?>

    i tried adding
    $wp_query->is_category = false;
    $wp_query->is_archive = false;
    $wp_query->is_home = true;

    under the query_posts but it doesnt work :(

    help pls

  • vanesta
    Member
    Posted 7 years ago #

    any help?

  • mikeall
    Member
    Posted 7 years ago #

    re Kafkaesqui:
    No I don't think I have that query_posts() in a template but after reading the codex I wasn't sure how to use it. is_home used to work but now it doesn't.

    The only thing that might be different is that I have set one static page to be the home page.

  • Ryan Boren
    WordPress Dev
    Posted 7 years ago #

    There is some debate over what is_home() should return if you have set a static page to be the front page.

  • cambray
    Member
    Posted 7 years ago #

    I seem to have the same problem. Since I upgraded to 2.1 from 2.03 on 3rd Feb 2007 I have lost the ability to set the home page for our church site: cambray dot org. The static page plugin versions 2.4 and 2.6 do not seem to work. I had a page called home.php (as far as I can remember ) I tried to rename it index as its slug name and it seemed to disappear. When wordpress had finished doing the attempted rename it sent me to a 404 page (which I guess is generated by the ISP host,1and1 dot co dot uk )cambray dot org/index - it had sedoparking dot com links on it . I have created a non wordpress index folder to prevent people arriving at a broken site if they arrive at the site this way. The host provider said something about the htaccess file. The text in the current htaccess one seems to be identical to the one when I backed up the site in 2006 other than the absense of wordpress on line 4 below RewriteBase /wordpress/

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
    </IfModule>

    # END WordPress

    If anyone has any ideas as I am out of my depth here. PS Thank you WordPress community for a great website tool !

    Jim

  • mstegink
    Member
    Posted 7 years ago #

    The debate is heading towards is_home beiing ment to return true for the blog home page and not the static frontpage. Is solved it in this direction by creating a plugin which gives us a new is_frontpage function which returns true only for the static frontpage.

    Check it out here: http://www.bos89.nl/1197/

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags