Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to create a basic wordpress theme. As far as I know the basic files I need are the style.css, header.php, index.php, footer.php, functions.php. Then it should show a blank site with some meta tags in the header.

These are my files:

functions.php

<?php
// load the language files
load_theme_textdomain('brianroyfoundation', get_template_directory() . '/languages');

// add menu support
add_theme_support('menus');

register_nav_menus(array('primary_navigation' => __('Primary Navigation', 'BrianRoyFoundation')));

// create widget areas: sidebar
$sidebars = array('Sidebar');

foreach ($sidebars as $sidebar)
{
    register_sidebar(array('name'=> $sidebar,
        'before_widget' => '<div class="widget %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<h6><strong>',
        'after_title' => '</strong></h6>'
    ));
}

// Add Foundation 'active' class for the current menu item 
function active_nav_class($classes, $item)
{
    if($item->current == 1)
    {
        $classes[] = 'active';
    }
    return $classes;
}

add_filter( 'nav_menu_css_class', 'active_nav_class', 10, 2);
?>

header.php

<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
    <meta charset="<?php bloginfo('charset'); ?>" />

    <meta name="description" content="<?php bloginfo('description'); ?>">

    <meta name="google-site-verification" content="">

    <meta name="author" content="Your Name Here">

    <!-- No indexing if Search page is displayed -->
    <?php if(is_search()){ echo '<meta name="robots" content="noindex, nofollow" />'; } ?>

    <title><?php wp_title('|', true, 'right'); bloginfo('name'); ?></title>

    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />

    <?php wp_head(); ?>
</head>
<body>
    <div id="page">
        <div id="page-header">
            <div id="page-title">
                <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a>
            </div>
            <div id="page-navigation">
                <?php
                    wp_nav_menu( array(
                    'theme_location' => 'primary_navigation',
                    'container' =>false,
                    'menu_class' => ''
                ); ?>
            </div>
        </div>
        <div id="page-content">

index.php

<?php get_header(); ?>

            <div class="page-blog">
                <?php get_template_part('loop', 'index'); ?>
            </div>
            <div class="page-sidebar">
                <?php get_sidebar(); ?>
            </div>

 <?php get_footer(); ?>

footer.php

            </div>
        <div id="page-footer">
            &copy; 2008 - <?php echo date('Y'); ?> All rights reserved.
        </div>
    </div>

    <?php wp_footer(); ?>
</body>
</html>

I activated the theme in wordpress. But it just shows nothing. Not even if I view the page source. Can anyone help?

share|improve this question
Do you have the appropriate header.php, footer.php etc. files in your theme folder? – tim Oct 23 '12 at 9:36
- themes -- mytheme --- header.php --- index.php --- functions.php --- footer.php --- style.css – HotPizzaBox Oct 23 '12 at 9:38
Please add some debug information – Mridul Aggarwal Oct 23 '12 at 9:50
Okay, are you serious? I already said that I have no debug information. I changed define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', true);.... but still no output of any kind not on the webpage, not in the apache error log... – HotPizzaBox Oct 23 '12 at 9:54

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.