• Hi there. New to wordpress but learning quickly. Downloaded and installed wp on server, then found the Onetone theme, download, installed and customized. I wanted this wordpress site to reside on a subdirectory so I followed instructions, built new subdirectory folder, moved contents, changed wordpress address URL and am able to login with my wp admin just fine and make changes.

    The problem is with my index.ph file. It’s pointing to the initial installation of WP and not the theme I downloaded and customized. I tried copying the Onetone index file to the root but it fails.

    Below is the content of the working index file. I’m guessing I need to tell the index file which theme to hit but I’m unsure how to do that. Thoughts?

    *******************************************************************************

    <?php
    /**
    * Front to the WordPress application. This file doesn’t do anything, but loads
    * wp-blog-header.php which does and tells WordPress to load the theme.
    *
    * @package WordPress
    */

    /**
    * Tells WordPress to load the WordPress theme and output it.
    *
    * @var bool
    */
    define(‘WP_USE_THEMES’, true);

    /** Loads the WordPress Environment and Template */
    require( dirname( __FILE__ ) . ‘/wordpress/wp-blog-header.php’ );

Viewing 7 replies - 1 through 7 (of 7 total)
  • Matt Knowles

    (@aestheticdesign)

    You do not need to make any changes to the index.php file to select the theme.

    If you’re trying to run WP from root, but have it installed in a subdirectory, make sure you’ve followed all of the steps here, especially #7.:

    https://codex.www.ads-software.com/Giving_WordPress_Its_Own_Directory#Moving_a_Root_install_to_its_own_directory

    If you’re trying to run it from the subdirectory, then make sure you followed all of these steps:

    https://codex.www.ads-software.com/Moving_WordPress#Moving_Directories_On_Your_Existing_Server

    Thread Starter Rileylaker

    (@rileylaker)

    Did all that and I am running a windows server. Left the web.config file alone on the root directory then moved all WP files/folders to new subdirectory. Made all the admin changes within WP. Problem is still which index.php file to use? There is one in every folder. One in main WP folder, one in wp-content folder, on in theme folder, etc etc. I have tried all of them and they all fail except for the index.php file from the main WP folder which loads the general WP website and not the theme I have programmed.
    How do I get the main WP index file pointing to the right theme?

    Thanks in advance for any guidance. This is getting frustrating.

    Thread Starter Rileylaker

    (@rileylaker)

    Here’s the info from within the web.config file in case it helps make sense…

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name=”wordpress” patternSyntax=”Wildcard”>
    <match url=”*”/>
    <conditions>
    <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true”/>
    <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true”/>
    </conditions>
    <action type=”Rewrite” url=”index.php”/>
    </rule></rules>
    </rewrite>
    <staticContent>
    <clientCache cacheControlMaxAge=”14.00:00:00″ cacheControlMode=”UseMaxAge”/>
    </staticContent><urlCompression doDynamicCompression=”true” dynamicCompressionBeforeCache=”true”/><caching>
    <profiles>
    <add extension=”.jpg” policy=”CacheForTimePeriod” duration=”00:01:00″ varyByHeaders=”Accept-Language”/>
    <add extension=”.css” policy=”CacheForTimePeriod” duration=”00:01:00″ varyByHeaders=”Accept-Language”/>
    <add extension=”.js” policy=”CacheForTimePeriod” duration=”00:01:00″ varyByHeaders=”Accept-Language”/>
    <add extension=”.jpeg” policy=”CacheForTimePeriod” duration=”00:01:00″ varyByHeaders=”Accept-Language”/>
    <add extension=”.gif” policy=”CacheForTimePeriod” duration=”00:01:00″ varyByHeaders=”Accept-Language”/>
    <add extension=”.png” policy=”CacheForTimePeriod” duration=”00:01:00″ varyByHeaders=”Accept-Language”/>
    <add extension=”.ico” policy=”CacheForTimePeriod” duration=”00:01:00″ varyByHeaders=”Accept-Language”/>
    </profiles>
    </caching></system.webServer>
    </configuration>

    Thread Starter Rileylaker

    (@rileylaker)

    Doing some more digging here and with me being new to wordpress, I thought I’d throw this out there too. In wp-admin, when I goto Appearance>Header, this shows the website that is live on my server. However, it’s not the theme I have selected. I am using the Onetone theme and when I goto Appearance> Onetone Options, I see the website I want to make live. The question now is how do I get the Onetone theme live? It’s a single page.

    Matt Knowles

    (@aestheticdesign)

    I’m unclear still where you want WordPress to run from.

    Are you wanting WordPress to run from the root directory or the sub directory?

    Thread Starter Rileylaker

    (@rileylaker)

    I’m wanting WordPress to run from the sub directory and not the root.

    Thread Starter Rileylaker

    (@rileylaker)

    WOW I FIGURED IT OUT!!!

    Front Page Displays – Your latest posts.

    Site is live and kicking now!

    Thanks Matt for the help nonetheless.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘index.php not hitting the right theme’ is closed to new replies.