• Resolved jongraphs

    (@jongraphs)


    Hello all.
    I’m working on this site, https://amadimag.com/blogosphere.

    I recreated the index.php from an HTML file, then inserted this code where I wanted the blog to appear (the previous code of index.php):

    <?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(‘./wp-blog-header.php’);
    ?>

    Problem is, now the CSS is not applied, and weird characters show up all throughout. Can anybody help? I guess I need to know where and in which php file the CSS is defined? Any and all help is appreciated.

Viewing 8 replies - 1 through 8 (of 8 total)
  • CSS is applied and the “weird” characters – as always – are due to user mistakes: encoding mismatch.
    WP’s “native” encoding is utf-8 and you shouldn’t mess with it. You changed it to 8859-1 but those posts were utf-8 (where you see the bad characters)

    Thread Starter jongraphs

    (@jongraphs)

    Thanks. I didn’t know I changed it, how do I change it back?

    It is in your head section – as on any website. Look at your source code – I read it from there…

    Thread Starter jongraphs

    (@jongraphs)

    I tried to change it back, but it’s still not working. here’s what I changed it to:

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    What is not working? Did you try Ctrl+F5?

    You had most of those weird characters in this post: https://amadimag.com/blogosphere/?p=109 – now they are all gone.

    Thread Starter jongraphs

    (@jongraphs)

    Yes, but the CSS info seems to be lost in some way. From what I can tell, the only difference is that all the fonts are bigger than they were. Do I have to reattach a stylesheet somehow?

    I still don’t understand why didn’t you just build a normal WP theme, instead of experimenting in this way… but that’s just me.

    Re: stylesheet. Man, no offense, but that style.css sucks, big time. You define the font size a zillion times, nobody can follow which element inherits what because it is a total mess. You have font size in %, in em, in px, in pt.
    For the moment the #content {font-size…} is screwing up your blog.

    Either learn CSS or get a pro who makes it work.

    Thread Starter jongraphs

    (@jongraphs)

    Thanks. You have been very helpful.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘blog loses CSS when php tag is embedded in HTML’ is closed to new replies.