• Resolved janpedryc

    (@janpedryc)


    I wanted to learn more about wp by building a small, simple theme. After creating couple of lines, I uploaded the files to the server and nothing shows up. Already checked the permissions of the files and tried gain some information via wp_debug, but without any success.

    style.css has only the default needed comment and functions.php is blank.
    I believe I messed something with the code:

    header.php

    <?php
    /**
     * The Header
     *
     * Displays all of the <head> section, header and top navigation areas
     *
     * @package basia
     *
     */
    ?>
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    	<head>
    	<meta charset="<?php bloginfo( 'charset' ); ?>" />
    	<title><?php wp_title(); ?></title>
    	<link rel="profile" href="https://gmpg.org/xfn/11" />
    	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    	<link rel="shortcut icon" href="<?php echo get_template_directory_uri(); ?>/favicon.ico" />
    <?php wp_head(); ?>
    </head>
    <body <?php body_class(); ?>>
    
    <!-- #b-header-container BEGIN -->
    <div id="b-header-container">
    
    	<header id="b-header-logo">
    		<div id="logo"><a href="<?php echo home_url() ?>/"><?php bloginfo( 'name' ); ?></a></div>
    		<div id="tagline"><?php bloginfo( 'description' ); ?></div>
    	</header>
    
    	<ul class="b-header-social">
    		<li class="social-fb"><a href="###"><img src="<?php echo get_template_directory_uri(); ?>/img/social-fb.png" /></a></li>
    		<li class="social-g"><a href="###"><img src="<?php echo get_template_directory_uri(); ?>/img/social-g.png" /></a></li>
    		<li class="social-t"><a href="###"><img src="<?php echo get_template_directory_uri(); ?>/img/social-t.png" /></a></li>
    		<li class="social-reddit"><a href="###"><img src="<?php echo get_template_directory_uri(); ?>/img/social-reddit.png" /></a></li>
    		<li class="social-wp"><a href="###"><img src="<?php echo get_template_directory_uri(); ?>/img/social-wp.png" /></a></li>
    		<li class="social-contact"><a href="###"><img src="<?php echo get_template_directory_uri(); ?>/img/social-contact.png" /></a></li>
    	</ul>
    </div>


    footer.php

    <?php
    /**
     * The template for displaying the footer.
     *
     * Contains the closing of the #b-container div and all content after
     *
     * @package basia
     */
    ?>
    
    <?php wp_footer(); ?>
    </body>
    </html>

    index.php

    <?php
    /**
     * The template for displaying home page.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package basia
     */
    
    get_header();
    ?>
    </div>
    <!-- #b-header-container END -->
    
    <p>
    	Some content and widgets to the right.
    </p>
    
    <?php
    get_footer();
    ?>

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi there!

    When you open your browser’s developer tools, is anything being rendered? Do you at least see the your admin bar while logged in? If not, that is an indication something is potentially failing.

    Try deactivating all your plugins to see if that resolves the issue.

    Thread Starter janpedryc

    (@janpedryc)

    Nothing is rendered and I don’t see the admin bar. But I can still access the admin panel.

    I deactivated all plugins and the problem still occurs.

    The permissions of the themes directory are 775 and inside:
    dir 775
    files 664

    In the themes directory are about 12 files, almost everyone blank. The only ones with content are the above three files and the stylesheet:

    style.css

    /*
    Theme Name: Basia
    Theme URI: https://janped.com/
    Author: Jan Pedryc
    Author URI: https://janped.com/
    Description: A simple theme
    License: GNU General Public License v2 or later
    License URI: https://www.gnu.org/licenses/gpl-2.0.html
    Tags: black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, flexible-width, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready
    Text Domain: basia
    
    This theme, like WordPress, is licensed under the GPL.
    Use it to make something cool, have fun, and share what you've learned with others.
    */

    The theme is tested on a fresh WP 4.4 on janbag.pl

    I changed the theme to twentyfifteen and everything works fine. After changing it again to my theme – blank site.

    EDIT:
    By creating the files and uploading them via FTP to the wp themes folder did I everything right? Or is there some place I should additionally note that a new theme is being added?

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Are you able to install any other themes?

    Let’s try using just the style.css and an index.php file. In the index file try using:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8">
    	<title>Document</title>
    </head>
    <body>
    
    </body>
    </html>
    Thread Starter janpedryc

    (@janpedryc)

    Changed the index.php file and got the same output.

    Downloaded the twentysixteen theme and everything works fine. It seems like wp wouldn’t see the files only within my theme directory. But the permissions look fine (drwxrwxr-x) and the directory name basia shouldn’t cause problems I think.

    EDIT: Tested also the Spacious Theme and it works fine.

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    How are you editing files? Through your hosting or a dedicated program like FileZilla?

    Try using: https://cloudup.com/cvnYrkk63Zf

    I created a blank theme with just those two files. Give that a try and see if it works.

    Thread Starter janpedryc

    (@janpedryc)

    It works.

    I edit the files through FileZilla. The files open in gedit, I save them and a pot up shows up if the file on the server should also be edited.

    I will try to minimize my files and pinpoint the problem, to give you back my findings.

    Thank you very much for your help, finally something works ??

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    That’s awesome! ( does happy dance )

    Please do post if/when you find what the issue is.

    Thread Starter janpedryc

    (@janpedryc)

    After a two day break I copied the files to my server to find what’s wrong, and … it works! I have no clue what went wrong the first time. I cleared the content cache of my browser constantly to be sure it’s not the problem. The other suggestion was a problem on the sever site, but than again why it worked after including your files?

    Still, I’m happy it works and I can again play with my theme ??

    Thank you very much for your help and happy New Year!

    Thread Starter janpedryc

    (@janpedryc)

    I got it!

    In the themes directory are about 12 files, almost everyone blank.

    This was the problem. Among the files was a blank home.php file.

    After your suggestion I took all files down and put your index.php and style.css, that’s why it started to work.

    Now everything (including my files) work, because I uploaded the files with content (index, style, header, footer). After including the blank file home.php, it takes over in the theme and actually do what it should – display a raw, white website ??

    I believe, to be specific, the body_class() in the body tag is causing the problem, trying to push the home.php – as it actually should ??

    I actually didn’t even start to make a template, and it’s so much fun already ??

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    blank home.php

    Darn template hierarchy! It will do crazy things. ??

    Glad to see it all worked out for you ??

    Thread Starter janpedryc

    (@janpedryc)

    Case closed ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Building simple theme, but won't show up.’ is closed to new replies.