WordPress.org

Ready to get started?Download WordPress

Forums

bloginfo returning wrong path (XAMPP on Windows) (5 posts)

  1. clintlalonde
    Member
    Posted 6 months ago #

    I have installed WordPress multi-site on my Win 8 machine using XAMPP 1.8.3. I am working with the PressBooks plugin, which uses a custom theme. I've got this plugin working many times before on a hosted server, but am having problems with the local XAMPP install on my machines.

    Basically, the stylesheet for the theme is not loading. Here is the code to the stylesheet when I view source:

    <link media="screen" href="C:\xampp\htdocs\pressbooks\wp-content\plugins\pressbooks/themes-root/pressbooks-publisher-one/style.css?1380173100" type="text/css" rel="stylesheet">

    That path is obviously incorrect. It should begin with http://localhost, not the path to XAMPP htdocs directory.

    When I look at the header.php file for the theme, I see that the code to generate the link is:

    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); echo '?' . filemtime( get_stylesheet_directory() . '/style.css'); ?>" media="screen" />'

    So, I test out the bloginfo('stylesheet_url') function and sure enough, it returns the wrong path:

    C:\xampp\htdocs\pressbooks\wp-content\plugins\pressbooks/themes-root/pressbooks-publisher-one/style.css

    Any idea why this might be? Anyone ever run into this where bloginfo has returned the incorrect path?

    Thanks,
    Clint

  2. conner_bw
    Member
    Posted 6 months ago #

    Hi,

    It's probably coming from the database. How it got there in the first place? No idea.

    Navigate to: My Catalog -> Network Admin -> Sites

    Click on the root site URL (Ie. the only site that isn't a book)

    Click the Settings tab.

    Anything weird in there? Specifically Siteurl, Home, ...

    Best regards,

  3. clintlalonde
    Member
    Posted 6 months ago #

    Thanks for responding.

    I checked the db and all looks ok to me. I found the following paths defined in the db

    wp_options table siteurl is set to http://localhost/pressbooks
    wp_site table domain is set to localhost and path to /pressbooks/
    wp_sitemeta table siteurl is set to http://localhost/pressbooks/
    wp_blogs table domain is set to localhost path to /pressbooks/

    The digging continues... :)

  4. edern
    Member
    Posted 4 months ago #

    Hi there. Same issue with a local installation of pressbook w/ Wamp.

  5. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    @edern: If you require assistance then, as per the Forum Welcome, please post your own topic.

Reply

You must log in to post.

About this Topic