WordPress.org

Ready to get started?Download WordPress

Forums

is_home for second language home page (5 posts)

  1. obiwan77
    Member
    Posted 4 years ago #

    I have 2 instances of wordpress installed on a single domain name, one for 1 language version, a second in a subfolder for the english version, like http://mydomain.com/en/

    On the home page of each version I want to display some specific text in the footer which should not display in internal posts or pages.

    On the 1st language version the is_home tag works well.

    However, for some reason, on the english version the is_home is not recognizing http://mydomain.com/en/ to be the homepage, hence the text does not display.

    How can I solve this to set the english site's homepage as the 'home' page?

  2. jkovis
    Member
    Posted 4 years ago #

    you might want to try is_front_page()

    also, what is listed for your WordPress address (URL) and Site address (URL) on wp-admin/options-general.php?

  3. obiwan77
    Member
    Posted 4 years ago #

    @jkovis
    thanks for your reply.
    is_front_page(): does not work either

    If I look at the General tab under settings the wp address (home) is: http://mydomain.com/en
    and the blog url is set to the same url.

    I looked at the code in the options-general.php file. Here is the part of the code that I believe is relevant, but I cannot interprete it correctly:

    <?php if ( !is_multisite() ) { ?>
    <tr valign="top">
    <th scope="row"><label for="siteurl"><?php _e('WordPress address (URL)') ?></label></th>
    <td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) echo ' disabled' ?>" /></td>
    </tr>
    <tr valign="top">
    <th scope="row"><label for="home"><?php _e('Site address (URL)') ?></label></th>
    <td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( defined( 'WP_HOME' ) ) echo ' disabled' ?>" />
    <span class="description"><?php _e('Enter the address here if you want your site homepage <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">to be different from the directory</a> you installed WordPress.'); ?></span>
  4. obiwan77
    Member
    Posted 4 years ago #

    BTW:
    the code I mention had been put in the footer.php file, and it works on the wp instance I installed at the root (french language version).

    on the english version (the one where is_home does not work), any change I make to the footer.php file is not taken into account, whether with the is_home tag or any simple text editing = is not updated on the site. It seems like an old version of the footer is displayed all the time.

    Any idea?

    cheers

  5. obiwan77
    Member
    Posted 4 years ago #

    I found a way around this:
    any changes made to the the footer.php file appearing through the wp dashboard (appearance-editor) was NOT accounted for.

    I manually copied, changed the footer.php file via ftp and uploaded the modified version. It works fine now.

    Any idea why the wp-admin access to the file does not update the "real" file?

Topic Closed

This topic has been closed to new replies.

About this Topic