Custom theme not getting the style
-
I made a quite simple html page layout with style and it’s just fine.
I’ve now cutted it into php files (header, footer and index). The theme gets activated in my site but it seems at least that the css isn’t linked. All I see is raw content. Actually I don’t even see my post images, but that’s later. One step at the time. Fisrt I need to get the layout to work.I’m REALLY beginner here and copied the loop straight out of WP docs just to get something out.
Header:
<html xmlns="https://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="navigation"> <ul id="nav"> <?php wp_list_pages('sort_column=menu_order&depth=1&title_li=');?> </ul> </div>
Footer:
<div id="bg"> <img src="images/bg.jpg" alt=""> </div> </body> </html>
Index:
<?php define('WP_USE_THEMES', false); get_header(); ?> <div id="archiveWrapper"> <div id="container"> <div class="post"> <!-- Start the Loop. --> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <!-- The following tests if the current post is in category 3. --> <!-- If it is, the div box is given the CSS class "post-cat-three". --> <!-- Otherwise, the div box will be given the CSS class "post". --> <?php if ( in_category('3') ) { ?> <div class="post-cat-three"> <?php } else { ?> <div class="post"> <?php } ?> <!-- Display the Title as a link to the Post's permalink. --> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. --> <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small> <!-- Display the Post's Content in a div box. --> <div class="entry"> <?php the_content(); ?> </div> <!-- Display a comma separated list of the Post's Categories. --> <p class="postmetadata">Posted in <?php the_category(', '); ?></p> </div> <!-- closes the first div box --> <!-- Stop The Loop (but note the "else:" - see next line). --> <?php endwhile; else: ?> <!-- The very first "if" tested to see if there were any Posts to --> <!-- display. This "else" part tells what do if there weren't any. --> <p>Sorry, no posts matched your criteria.</p> <!-- REALLY stop The Loop. --> <?php endif; ?> </div> </div> <?php get_footer(); ?>
CSS:
@charset "utf-8"; /* Theme Name: My name Theme URI: https://www.mysite.net Description: Personal theme designed by Tomi Palonen Version: 1.0 Author: Tomi Palonen Author URL: https://www.samsarala.net */ body { margin:0 0 0 0; } #bg { position:fixed; top:-50%; left:-50%; width:200%; height:200%; z-index: 1; } #bg img { position:absolute; top:0; left:0; right:0; bottom:0; margin:auto; min-width:50%; min-height:50%; } #navigation { position:fixed; background-color: #CCCCCC; height: 80px; width: 500px; left: 10%; top: 0px; right: auto; bottom: auto; z-index: 2000; } #archiveWrapper { position:relative; background-color: #FFFFFF; position:absolute; left:50%; top:150px; margin: 0 0 0 -450px; height: 2000px; width: 900px; z-index: 1000; } #container { position:relative; background-color: #DDDDDD; height: 300px; width: 900px; margin-bottom: 40px; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom theme not getting the style’ is closed to new replies.