Daniel Morgan
Daniel Morgan

Reputation: 561

include file and https stops my css from working

Okay, so I have a really odd problem... I have this line at the top of my page, because I want to get the latest wordpress blog post (which is fine, the post comes back);

<?php
    require('./blog/wp-load.php');
?>

But then whenever I visit a page on my website that has https:// in the url it seems to stop my css file from working would anyone be able to help? thanks

Upvotes: 0

Views: 109

Answers (1)

Jonathan Marzullo
Jonathan Marzullo

Reputation: 7031

in wordpress its always best to use the right api method:

http://codex.wordpress.org/Function_Reference/site_url

<?php
     $url = site_url();
     require($url. /blog/wp-load.php');
?>

The site_url template tag retrieves the site url for the current site (where the WordPress core files reside) with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. If scheme is 'http' or 'https', is_ssl() is overridden. Use this to get the "wordpress address" as defined in general settings. Use home_url() to get the "site address" as defined in general settings.

Upvotes: 1

Related Questions