The MU forums have moved to WordPress.org

Theme for Main Blog works, Sub-Domains show only text (14 posts)

  1. just2izy
    Member
    Posted 14 years ago #

    I am using a theme on my main blog (http://233.com.gh), which has been activated site wide and also on individual sub-blogs (eg. tech.233.com.gh). I am using the sub domain installation.

    The main blog displays the theme correctly but the sub-blogs only show the text possibly because it cannot access the theme files.

    Looked through the forums cannot find an exact similar problem.

  2. just2izy
    Member
    Posted 14 years ago #

    I just did something I should have done a while back and realized the images and other theme files are linking to an actually sub-domain folder;

    <img title="Ghana\'s Tech Hub" alt="Ghana\'s Tech Hub" src="http://tech.233.com.gh/wp-content/themes/Comfy_Pro/styles//img/">

    Although the path isn't complete, and therefore should error, I suddenly feel like I am misunderstanding sub-domains in WPMU.

    Does a WPMU sub-domain install mean a similar folder structure to if I had created say 3 single Wordpress installs and put 2 on sub domains I created myself.

    What about the <b>blogdir/ID/</b> folder structure. Where do they come in?

  3. just2izy
    Member
    Posted 14 years ago #

    Wait after inspecting my server folders, there is no such sub-domain folder structure as;

    '<img title="Ghana\'s Tech Hub" alt="Ghana\'s Tech Hub" src="http://tech.233.com.gh/wp-content/themes/Comfy_Pro/styles//img/">'

    Why then does the blog at tech.233.com.gh try to link to theme files at that location? Shouldn't it be pointing to a single wp-content folder and not one per sub-domain blog created.

    I have the Userthemes plugin and New Blog Defaults plugin in my mu-plugins folder. I have not really configured either of them yet> Could this be a reason??

    My permalinks seem also to be messed up. Clicking on the Hello World post in tech.233.com.gh brings 404 Error.

    I am beginning to think I have a .htaccess problem rather. Ok since that would taint this thread will search for .htaccess errors and update this if solving that makes my pain go away.

  4. andrea_r
    Moderator
    Posted 14 years ago #

    My permalinks seem also to be messed up.

    this is why the image rewrite rules aren't working correctly. MU stores the images in an alternate location, as you've discovered.

    Fix the permalinks & see if the images get fixed.

  5. just2izy
    Member
    Posted 14 years ago #

    Hmmm... OK, so I fixed the .htaccess problem. No more 500 errors and WPMU has access to the .htaccess file. Clicking the 'Hello World' posts now work.

    However still have the theme images problem and I need clarification.

    What happens when; `bloginfo('template_directory'); is used in WPMU themes?

    Isn't that what causes the subdomain to be used as part of the path to the theme files? That is; src="<?php bloginfo('template_directory'); ?>/styles/

    Main blog (http://233.com.gh): src="http://233.com.gh/wp-content/themes/Comfy_Pro/styles/........

    Sub blogs on Subdomains (tech.233.com.gh): src="http://tech.233.com.gh/wp-content/themes/Comfy_Pro/styles/........

    Do I have to rework the theme to use; get_bloginfo
    rather??

  6. just2izy
    Member
    Posted 14 years ago #

    I think stating what I am trying to achieve may help in resolving my problem.

    We want to use Wordpress as a CMS for our content portal. So this is what we need to achieve;

    1. Main site (or Blog): 233.com.gh;
    ** Use custom permalinks (/%year%/%monthnum%/%category%/%postname%/) and Category base (sections)
    2.Content categories (Tech,Lifestyle,Humour,.....) as subdomain sub blogs (tech.233.com.gh,lifestyle.233.com.gh,.....)

    We will be using modified versions of the same theme( Will cross that when we get there, seen the forum posts on how to do that).

    Ok So far;
    1. Installation done and working;

    2. Theme installed and working on 233.com.gh

    3. Subdomain blogs created and assigned themes (the same theme as 233.com.gh) and this is where the troubles began.

    The theme uses bloginfo('template_directory'); to output paths for theme files and images and the sub blogs info breaks this functionality because currently the theme folder is;

    http://233.com.gh/wp-content/themes/Comfy_Pro/styles/........

    but the bloginfo('template_directory'); turns the path into

    http://tech.233.com.gh/wp-content/themes/Comfy_Pro/styles/........

    Can I change any settings for the sub blogs (siteurl, template directory) to modify this behaviour?

    I am comfortable (but not an expert) with mySQL through PHPMyAdmin
    and have full access to my server.

    Another problem which may be linked and may be why Andrea answered about getting the permalinks right is that clicking on categories in the main blog or sub blogs instead of taking you to the cateory archive page brings a White Screen of Death.

    Makes me wonder my issue theme related from the bloginfo or permalink related??

    Sorry Andrea if I have duplicated some of the info here, just wanted to give a clearer picture.

  7. andrea_r
    Moderator
    Posted 13 years ago #

    What happens when; `bloginfo('template_directory'); is used in WPMU themes?

    Isn't that what causes the subdomain to be used as part of the path to the theme files? That is; src="<?php bloginfo('template_directory'); ?>/styles/

    Yes. Any WordPress template tag will look in that blog's themes. Or, since all themes are shared, it only *looks* like it's looking there. it;s still using the physical files of the main theme's folders.

    Do I have to rework the theme to use; get_bloginfo
    rather??

    No.

    There's something wrong with your setup. it is not the code in the themes. What happens when you create a new blog & it gets the default theme?

    Please check your .htaccess file against htaccess.dist and make sure it is exactly the same EXCEPT for the BASE line (which should be different).

  8. andrea_r
    Moderator
    Posted 13 years ago #

    And did you do the wildcard subdomains properly?

  9. just2izy
    Member
    Posted 13 years ago #

    What happens when you create a new blog & it gets the default theme?

    A new blog using the default theme works without any issues.

    After you explained about the tags just only appearing to *look* in a subdomain folder I have discovered where the actual error may be.

    The theme uses the styles folder to allow variants of the theme. That is;

    ..../Comfy_Pro/styles"/default/....
    ..../Comfy_Pro/styles/yellow/....

    to allow for variations. Lets use logo.png as an example.

    Now the main blog (233.com.gh) works and has path as;
    src="http://233.com.gh/wp-content/themes/Comfy_Pro/styles/default/img/logo.png"

    And the sub blogs (tech.233.com.gh) not working has path

    src="http://233.com.gh/wp-content/themes/Comfy_Pro/styles//img/"

    The default style path and the actual image file are not output by the code when using themes other than the default theme. If you missed it then here it is; src="http://233.com.gh/wp-content/themes/Comfy_Pro/styles/MISSING_PATH_TO_FILES/img/MISSING_FILE"

    check your .htaccess file against htaccess.dist

    I compared (Notepad++ compare) the two files and they were the same.

    Subdomian wildcards

    Yes I think I did. Only difference between what I had and what was recommended was instead of vhost.conf I had to use the httpd.include (backed up, of course). Checked DNS information for *.233.com.gh, Entry in the serverAlias portion of the Apcahe file.

    Hmm since it may be a setup issue will a fresh installation help??

  10. andrea_r
    Moderator
    Posted 13 years ago #

    So it's really a problem with the theme.

    "And the sub blogs (tech.233.com.gh) not working has path

    src="http://233.com.gh/wp-content/themes/Comfy_Pro/styles//img/""

    See where it's stuffing in the extra slash? Because it;s doing that, it can't find the images later on.

    Go try any other theme. Bet it works.

  11. just2izy
    Member
    Posted 13 years ago #

    Actually its not an extra slash but a missing section. Let me paste the theme code to output the path. That will help.

    <a href="<?php bloginfo('url'); ?>" id="logo"><img src="<?php bloginfo('template_directory'); ?>/styles/<?php echo $comfy['style']; ?>/img/<?php echo $comfy['logo']; ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>" /></a>

    I just want to confirm that its not an MU issue but the theme so I can go get the theme dev to solve it.

    Just about to try another theme.

  12. just2izy
    Member
    Posted 13 years ago #

    Sorry didn't point out where the error occurs.

    echo $comfy['style'] and echo $comfy['logo'] fail when it is not the main blog and therefore the path is incomplete. Why does it work on the main blog then??

    When I manually add the required missing style and logo parts it works. Wish I knew more PHP, sigh...

  13. andrea_r
    Moderator
    Posted 13 years ago #

    It's the theme.

    Look at any html source on any blog on wordpress.com. they have the subdomain in the theme url.

  14. just2izy
    Member
    Posted 13 years ago #

    Yes, its conclusive now. Tried other themes and they work.

    Its a well designed theme but I'm beginning to think the Support is bad.

    Thanks for all the help, Andrea.

About this Topic

  • Started 14 years ago by just2izy
  • Latest reply from just2izy