• Resolved aiden123

    (@aiden123)


    Hey I’m learning how to create my first theme, all coding done for index.php, header.php, footer.php, sidebar.php and style.css, all in the same directory, I tried to preview my blog using live preview from the admin page and also tried going to the direct link http://www.site.com/wp/wp-content/themes/tutorial_theme/index.php, neither work or load anything.

    Any help would be much appreciated.

    P.S all other themes and what not work perfectly.

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

    (@jcastaneda)

    THEME COFFEE MONKEY

    You preview the theme from the Dashboard under the Appearance page. There you will see all themes that are installed. You can then preview by using the preview button for each theme.

    Thread Starter aiden123

    (@aiden123)

    Hey Jose,

    Thanks for the fast reply, I tried that but when I click live preview I get the following page

    http://streetmint.byethost18.com/ss.png

    The preview is just blank and nothing loads.

    Any help with this?

    Thanks heaps for your time!
    Aiden

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    What does the console say ( in your developer tools ) or the error_log?

    Thread Starter aiden123

    (@aiden123)

    The page doesn’t even load, not even the top wordpress menu bar loads, even if I activate the theme? All other pre designed themes work. I tried activating the console and the error log using the following code:

    // Enable WP_DEBUG mode
    define('WP_DEBUG', true);
    
    // Enable Debug logging to the /wp-content/debug.log file
    define('WP_DEBUG_LOG', true);
    
    // Disable display of errors and warnings
    define('WP_DEBUG_DISPLAY', false);
    @ini_set('display_errors',0);
    
    // Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
    define('SCRIPT_DEBUG', true);

    in the wp-config.php file.

    No errors come up, or am I going about this all wrong?

    Thanks again for your time and help!

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    What happens if you use only an index file and the style file?

    Thread Starter aiden123

    (@aiden123)

    Nothing changes, I added in the header and footer code to index.php, here is the code for the entire page (incase that’s the problem, I doubt it but you never know.

    index.php: http://pastebin.com/0xQDnTGm

    style.css: http://pastebin.com/GBAa4qyV

    Thanks once again for your help!

    [ Please use pastebin.com or gist.github.com if you are including a lot of code ]

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    If that is the exact code I would suggest removing the /* comments*/ from the file(s).

    We’ll start from scratch. Try the following in the index:

    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
        <meta charset="<?php bloginfo( 'charset' ); ?>">
        <title><?php wp_title(); ?></title>
    </head>
    <body>
        <?php the_post(); ?>
        <?php the_content(); ?>
    </body>
    </html>

    If nothing happens then make sure that all plugins are deactivated. If this still doesn’t work then Houston we may have a problem. πŸ˜€

    Thread Starter aiden123

    (@aiden123)

    Thanks for the speedy reply man!

    So what happened was instead of a theme being display in the live preview the following code was displayed <!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <title><?php wp_title(); ?></title> </head> <body> <?php the_post(); ?> <?php the_content(); ?> </body> </html>

    Which is the code I put in index.php (copy and pasted your above code), I assume this isn’t what is meant to happen? Weird that it would output the pages code?

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    That is super strange!

    I’m inclined to say that your current setup may not be configured properly but you can clearly access your Dashboard.

    Have you tried re-installing WordPress? It almost sounds extreme but worth a shot. Delete all but wp-config.php and the wp-content folder. Or you can ask your site’s host to help you out.

    Thread Starter aiden123

    (@aiden123)

    hey thanks heaps for that! So I reinstalled and had to delete everything, just renamed the wp-config file and wp folder only containing the wp-content so I can use them for future reference.

    So the code I was using originally still shows nothing in the live preview for whatever reason? Perhaps it’s deprecated? Or maybe a line or 2 are no longer valid syntax or have been changed slightly so they don’t work now (not sure how old the tutorial was).

    Anyhow I tried inputting your:

    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <title><?php wp_title(); ?></title>
    </head>
    <body>
    <?php the_post(); ?>
    <?php the_content(); ?>
    </body>
    </html>

    That just came up as before as text on the screen, an output of the code, when I replaced all the ascii codes to their actual things (e.g. < = <) it worked and displayed “Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!” so it works now. Do you know why the first lot of code didn’t work? Or a link to a tutorial for creating your own theme that will work lol?

    Thanks so much for your time and help I really appreciate it !

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    I’m happy to see you finally got it working! πŸ˜€

    One of the more popular ones is: http://themeshaper.com/2012/10/22/the-themeshaper-wordpress-theme-tutorial-2nd-edition/

    Great starting point since they break things down. πŸ™‚

    Thread Starter aiden123

    (@aiden123)

    Thanks so much for your help man, I really appreciate it! I hope you have an amazing day/night (which ever it may be when you read this :D)

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Totally happy to help! πŸ™‚

    day/night

    They all blend together for me. πŸ˜‰

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Created my first theme, blog won't load in live preview or through direct link’ is closed to new replies.