Reputation: 520
I created a website and added wordpress to it for others to easily manage the content. The theme works perfectly on the page designated for the homepage and not for every other page. Pages in question appear as though the stylesheet is missing.
I'm currently working from my localhost.
This is my header.php file:
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset');?>">
<title><?php
global $page, $paged;
wp_title( '|', true, 'right' );
bloginfo( 'name' );
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s' ), max( $paged, $page ) );
?></title>
<link href="wp-content/themes/theme_name/css/carousel.css" rel="stylesheet" type="text/css" media="all"/>
<link href="wp-content/themes/theme_name/css/style.css" rel="stylesheet" type="text/css" media="all">
<?php wp_head(); ?>
</head>
<body>
<div id="wrap">
<div class="header">
<nav>
<div class="login">
<a href="login.html"></a><span class="login-icon"><p><a href="login.html">Login / Register</a></p>
</span>
</div>
<div class="logo">
<img src="wp-content/themes/theme_name/img/logo.png" alt=""/>
</div>
<div class="navbar">
<?php
wp_nav_menu(array(
'theme-location' => 'primary-menu',
'menu_class' => 'nav',
'fallback_cb' => 'wp_page_menu'
));
?>
</div>
</nav>
And this is my page.php file (it's the same as the index.php file):
<?php
get_header(); ?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
<div class="entry-thumbnail">
<?php the_post_thumbnail(); ?>
</div>
<?php endif; ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php endwhile; ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>
Thank you
Upvotes: 1
Views: 1381
Reputation: 892
In your header.php, use this:
<link href="<?php echo get_template_directory_uri(); ?>/css/style.css" rel="stylesheet">
instead of this:
<link href="wp-content/themes/theme_name/css/style.css" rel="stylesheet" type="text/css" media="all">
...do the same for the other stylesheet too.
Upvotes: 3