Forums

wp-config absolute path (4 posts)

  1. GOBLUE14
    Member
    Posted 5 years ago #

    I've got a mini-loop working in the header of a site I'm working on, and have implemented it into a theme format. It works great when it's part of a static page on the site. However, when I try to view it through WordPress, it either can't find wp-config.php, or puts the directory name in twice.

    You can see it working at http://www.indigospringshoa.com/index_new3.php However, when I activate the theme and try to click a headline, it sends me to http://www.indigospringshoa.com/wordpress/wordpress/(post information).

    Where is that extra "wordpress" directory coming from? I've tried about every other way to get the absolute path right ("../wordpress/wp-config.php", "./wp-config.php", etc.) and nothing wants to work right.

    Thanks!

  2. moshu
    Member
    Posted 5 years ago #

    Help me to understand... why on the earth would you need the wp-config file for a theme???

  3. GOBLUE14
    Member
    Posted 5 years ago #

    It's in a "mini-loop" in the header to list the 5 latest posts.

    Although looking at it again, maybe inside the theme I just need to use the PHP for "Recent Posts", and leave the wp-config part for the static pages on the site.

    I was going with this info from the codex to get the headlines on a static page and just transferred it over when I pieced together the theme, but I think I see what's up now. (Or at least another avenue to try out!) Thanks!

  4. GOBLUE14
    Member
    Posted 5 years ago #

    Yep, that was it!

    Just used:
    <?php wp_get_archives('type=postbypost&limit=5'); ?>

    to get the Recent Posts rather than the mini-loop idea for static pages.

Topic Closed

This topic has been closed to new replies.

About this Topic