1

I am new with wordpress so please feel free to point out any fundamental misunderstandings I have in the following question.

Problem: I have created the beginnings of a website using Html/css, but realized that I wanted to give my client more control over it so I wanted to convert it to wordpress so I can add customizable images/text and take advantage of wp plugins.

Solution: So I changed the name of my index.html to functions.php, and uploaded my index and stylesheet to wordpress. The only change I made was to change the address of my css file.

To correctly link my css file I have changed

<link rel="stylesheet" type="text/css" href="style.css">

to

<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_uri(); ?>"/>

Error: However, now my html is just showing up plain without change from css. What am I doing wrong here? (Also if you are experienced with wordpress I would love to message for 5 minutes to clear some misununderstandings I know I have)

2 Answers 2

0

Welcome to WordPress.

WordPress uses themes to show HTML and CSS structure. These are located in wp-content/themes.

I'm not sure where you're placing these files, but functions.php should not have any HTML structure in it at all. Think of functions.php as a list of instructions you're going to give WordPress on how to load components of your theme. My advice would be to undo what you've done so far.

A good place to start learning theme development is taking a look at the default themes that come with WordPress, like Twenty Seventeen and Twenty Twelve. Add your css to the stylesheets in those themes. Play with the structure of the header.

There are plenty of links around on how to build your own theme from scratch. I would link to them here, but they get cranky about links in answers.

Sign up to request clarification or add additional context in comments.

Comments

0

The proper way to add styles to a WordPress theme is to enqueue them.

To enqueue "style.css" use this:

wp_enqueue_style( 'style', get_stylesheet_uri() );

If you wish to use a different CSS file, change the file name of 'style' and do not include the file extension.

Reference: https://developer.wordpress.org/themes/basics/including-css-javascript/#stylesheets

This answer to a similar question should help: https://stackoverflow.com/a/37391567/3130549

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.