• Hey everyone!

    I’m designing a new website using WordPress and I want to make a custom theme. So far I’ve created header.php, index.php, footer.php and style.css. My goal is to keep everything as simple as possible.

    My first problem is that the php tags from WordPress (from the Codex) won’t work. Like the <title> tag. It doesn’t look like it wants to use my CSS either.

    My header.php looks like this:

    <html>
    <head>
    <title><?php wp_title( $sep, $display, $seplocation ); ?></title>
    <link href="<?php bloginfo( 'pingback_url' ); ?>">
    </head>
    <body> ...

    index.php:

    <?php get_header(); ?>
    
    INNHOLD
    
    <?php get_footer(); ?>

    footer.php:

    </div>
    
    </div>
    </body>
    </html>

    What’s wrong?

Viewing 9 replies - 1 through 9 (of 9 total)
  • My first problem is that the php tags from WordPress (from the Codex) won’t work.

    I don’t see why not. There’s nothing special about the PHP that WordPress uses. Incidentally, that’s not the recommended way to use wp_title() in a theme. See https://codex.www.ads-software.com/Plugin_API/Filter_Reference/wp_title

    It doesn’t look like it wants to use my CSS either

    There’s no reference to any style.css file in your header.php file. Have you tried looking at the header.php file from Twenty Twelve?

    And you’re missing <?php wp_footer(); ?> from your footer.php file. It should be added just before the closing <?body> tag.

    Thread Starter Phoenix39

    (@phoenix39)

    Thanks for the reply!

    I tried the <title><?php wp_title('|', true, 'right'); ?></title> too, but that didn’t work either.

    What is the correct way to link to my css? The code from twentytwelve didn’t work, I could only make it work by inserting the direct url to the stylesheet.

    Also, what does the footer php code do?

    Try just using <title><?php wp_title(':');?></title>

    Thread Starter Phoenix39

    (@phoenix39)

    That didn’t work either

    It does. I’ve used it in more than 50 custom themes. There must be a problem elsewhere in your theme.

    Thread Starter Phoenix39

    (@phoenix39)

    Yep, any ideas though?

    Sorry – no.

    Thread Starter Phoenix39

    (@phoenix39)

    Everything seems so weird since I started using a theme from scratch… I also noticed the custom menu option in the admin cp disappeared.

    Should I just use twentytwelve and edit the code there rather than starting from scratch? Or could someone tell me which codes are important from the old theme? I just made a simple theme with basic html and threw out most of the php/script codes…

    I also noticed the custom menu option in the admin cp disappeared.

    Sounds like you have a fairly serious problem in your theme.

    I just made a simple theme with basic html and threw out most of the php/script codes

    Such as? Some of that code may have been necessary. If you want to start with a basic theme, I’d suggest using https://www.ads-software.com/themes/toolbox

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Problems with my new theme’ is closed to new replies.