VMaklaud
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: get_header() doesn't work with custom pagesI have some corrections. The content moves left only in IE9. In chrome, firefox and opera it’s ok. But anyway the <head> is empty in any browser. Can anyone tell me the reason? Again – it’s fixed if I put Template Name and get_header() in one <?php ?> tag, but I don’t think it’s a good solution, because it MUST work even if I use two tags.
Forum: Fixing WordPress
In reply to: get_header() doesn't work with custom pagesThe image is not necessary, the content just moves left and styles are not applied. The reason – empty <head> tag. And I would like to know why.
[Moderator Note: No bumping. If it’s that urgent, consider hiring someone instead.]
Forum: Fixing WordPress
In reply to: get_header() doesn't work with custom pagesThis really confuses me. Here is the code from one of the WP themes:
<?php /* Template Name: Tags */ ?> <?php get_header(); ?>
Right my first version – two php tags. But I don’t understand why it works in their theme but doesn’t work in mine.
Forum: Fixing WordPress
In reply to: get_header() doesn't work with custom pagesWhy isn’t is valid? What is random php?
Forum: Fixing WordPress
In reply to: get_header() doesn't work with custom pagesI think I have the solution, but I don’t understand it.
Old version of any custom page (different php tags for the commands):
<?php /* Template Name: Contact */ ?> <?php get_header(); ?>
New version (get_header and template name in the same php tag):
<?php /* Template Name: Contact */ php get_header(); ?>
Now everything looks fine. But could anyone explain this to me? I think it shouldn’t be so important if I write those to commands in one or two php tags, but that really matters.
Forum: Fixing WordPress
In reply to: get_header() doesn't work with custom pagesI have also tried this advice, but it doesn’t help, either.
Forum: Fixing WordPress
In reply to: get_header() doesn't work with custom pagesSenff, I have only one “standard” page – index.php, others are custom (abount, contact etc.).
Here is my header.php code. It works fine in index.php, but wrong with custom pages.
<!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo('charset'); ?>" /> <title><?php wp_title(); ?></title> <link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" /> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <div id="wrapper"> <div id="header"> <div class="column-full"> <div id="logo"> <a href="<?php echo home_url('/'); ?>" title="<?php bloginfo('name') ?>"> <img src="<?php echo get_template_directory_uri() . "/images/logo.png"; ?>" alt="<?php bloginfo('name') ?>" /> </a> </div> <!-- logo --> <div id="navigation" class="float-right"> <?php if (function_exists('has_nav_menu') && has_nav_menu('primary-menu')) : ?> <?php wp_nav_menu(array( 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav float-left', 'theme_location' => 'primary-menu')); ?> <?php else : ?> <ul id="main-nav" class="nav float-left"> <li class=""><a href="<?php echo home_url('/'); ?>">Home</a></li> <li class=""><a href="<?php echo home_url('/about/'); ?>">About</a></li> <li class=""><a href="<?php echo home_url('/contact/'); ?>">Contact</a></li> </ul> <!-- main-nav --> <?php endif; ?> </div> <!-- navigation --> </div> </div> <!-- header -->
In index.php it looks well. In custom pages <head> contains only <title> and every content (header and body) is moved left.
Forum: Fixing WordPress
In reply to: get_header() doesn't work with custom pagesI don’t have a site, yet. Just making my first theme and test in using a local server.
Forum: Fixing WordPress
In reply to: get_header() doesn't work with custom pagesChristian1012, no differences at all.
I call the header without the parameter – just get_header(); in both index.pho and (e.g.) contact.php.Forum: Fixing WordPress
In reply to: get_header() doesn't work with custom pagesHey guys, any advice?
I still don’t see the error, everything is done with tutorials, but the header looks terrible.