• I seem to be running into a weird error when trying to set up my custom theme. Basically, my files are like this:

    angelina-marie > wordpress >wp-content > themes > wp-portfolio

    The “wp-portfolio” is a new theme I have created.

    Every time I try to load my css into the function.php, my css does not load. When I look at my website’s page source, I see it is because the css is pulling up the twenty twelve theme’s css. I do not understand why this is happening! I have totally deleted the twenty twelve theme, and have re-written this code and double-checked the syntax for days.

    Do you have any ideas as to what could be causing this problem?

    My site is angelina-marie.com. Lines 32-33 show the “twenty-twelve” files.

    Thanks in advance!

Viewing 15 replies - 1 through 15 (of 31 total)
  • Can you post your functions.php to Pastebin and post the link here? Also, is your theme based on Twenty Twelve in any way? You have lines like:

    <link rel='stylesheet' id='twentytwelve-style-css' href='http://www.angelina-marie.com/wp-content/themes/wp-portfolio/style.css?ver=3.9.2' type='text/css' media='all' />

    in your header. The code I posted has an ID of twentytwelve-style-css, but it’s loading a stylesheet from your custom theme.

    Thread Starter ambethoney

    (@ambethoney)

    This is my functions.php code:

    http://pastebin.com/wBXmkr3m

    I don’t want anything Twenty Twelve in my custom theme folder, I can’t figure out why it keeps grabbing something from Twenty Twelve. I deleted that whole folder!

    Thanks for taking a look for me!

    Thread Starter ambethoney

    (@ambethoney)

    This is my functions.php code:

    http://pastebin.com/wBXmkr3m

    I don’t want anything Twenty Twelve in my custom theme folder, I can’t figure out why it keeps grabbing something from Twenty Twelve. I deleted that whole folder!

    Thanks for taking a look for me!

    Hmm, that’s not what I expected to see in your functions.php. How are you loading your stylesheets? Are you calling them in header.php?

    Thread Starter ambethoney

    (@ambethoney)

    Sorry I haven’t responded, I was visiting relatives in Nowheresville, TX and didn’t have internet access.

    I’ve been following the Treehouse courses to figure out how to best set up my files. Is the functions.php wrong? Or is there a better way of doing it?

    This is my header.php:
    http://pastebin.com/YQ5xuAdb

    And my functions.php:
    http://pastebin.com/mJZdXMB3

    I still can’t figure out why it’s calling for the twenty-twelve versions

    You need to check your functions.php ASAP because your site isn’t loading correctly right now. You shouldn’t use the closing PHP tag (?>) in that file, and there should be no white space at all after the final line. So in your case, the final line should be:

    add_action( 'wp_enqueue_scripts', 'theme_styles');

    and it should be the absolute last thing in the file. No spaces, no carriage returns.

    If I can’t see the site, it’s hard to help.

    Thread Starter ambethoney

    (@ambethoney)

    It’s not? I just checked, and it is there :

    http://www.angelina-marie.com

    If you go to your Dashboard > Appearance > Themes, what theme is currently listed as your active theme? Right now, your site is trying to load Twenty Twelve’s stylesheet, but since you said you deleted that theme, it can’t find the stylesheet.

    Thread Starter ambethoney

    (@ambethoney)

    My active theme is my custom theme. I am receiving a new error, that my custom theme is missing a style and template sheet. I’m not sure why. These are the files I am working with:

    index.html
    index.php
    style.css
    header.php
    footer.php
    functions.php

    all files are located in the same folder. I’ve never received this error before, and I’m still not sure why it’s looking for the Twenty Twelve stylesheet. I am not working off of a child theme.

    What folder are all the files you listed contained in? What is the name of your theme (as defined by “Theme Name:” in your stylesheet)?

    Thread Starter ambethoney

    (@ambethoney)

    The folder with all of my files is wp-portfolio. My “Theme Name” is Angelina Marie. Do they need to be the same?

    Technically not, although it makes it easier to keep everything straight. And “Angelina Marie” is currently listed as your active theme?

    Thread Starter ambethoney

    (@ambethoney)

    I updated my WP just before leaving for TX. I am now realizing that my theme has been changed to the Twenty Fourteen theme, and it is not allowing me to change it. I’m assuming the update is what shook out my template and style sheet, right?

    Do you have any other themes installed besides Twenty Fourteen right now? Did you create “Angelina Marie” by modifying any files or copying any code from the Twenty Twelve theme?

    Thread Starter ambethoney

    (@ambethoney)

    I had an “Angelina Marie” template. It was new, not a child theme of Twenty Twelve. I didn’t copy or modify any of the Twenty Twelve folders for my own theme. The Twenty Fourteen seems to have wiped out the AM theme. It’s not allowing me to deactivate the 2014 theme.

Viewing 15 replies - 1 through 15 (of 31 total)

The topic ‘get_template_directory Loads The Wrong File’ is closed to new replies.