I have been trying To have No header for My Landing Page,but a sticky nav Bar On the header for the rest of my pages.
I edited the header(header.php),but it gets applied to all the pages.I would like The header To not show on the landing page.
Here is my code.
<?php
/*
* Header Section of Iconic One
*
* Displays all of the <head> section and everything up till <div id="main">
*
* #package WordPress - Themonic Framework
* #subpackage Iconic_One
* #since Iconic One 1.0
* /
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<header id="masthead" class="site-header" role="banner">
<?php if ( get_theme_mod( 'themonic_logo' ) ) : ?>
<div class="themonic-logo">
<img src="<?php echo get_theme_mod( 'themonic_logo' ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
</div>
<?php if( get_theme_mod( 'iconic_one_social_activate' ) == '1') { ?>
<div class="socialmedia">
<img src="<?php echo get_template_directory_uri(); ?>/img/twitter.png" alt="Follow us on Twitter"/> <img src="<?php echo get_template_directory_uri(); ?>/img/facebook.png" alt="Follow us on Facebook"/> <img src="<?php echo get_template_directory_uri(); ?>/img/gplus.png" alt="Follow us on Google Plus"/><img src="<?php echo get_template_directory_uri(); ?>/img/rss.png" alt="Subscribe RSS"/>
</div>
<?php } ?>
<?php else : ?>
<hgroup>
<?php bloginfo( 'name' ); ?>
<br .../> <a class="site-description"><?php bloginfo( 'description' ); ?></a>
</hgroup>
<?php if( get_theme_mod( 'iconic_one_social_activate' ) == '1') { ?>
<div class="socialmedia">
<img src="<?php echo get_template_directory_uri(); ?>/img/twitter.png" alt="Follow us on Twitter"/> <img src="<?php echo get_template_directory_uri(); ?>/img/facebook.png" alt="Follow us on Facebook"/> <img src="<?php echo get_template_directory_uri(); ?>/img/gplus.png" alt="Follow us on Google Plus"/><img src="<?php echo get_template_directory_uri(); ?>/img/rss.png" alt="Follow us on rss"/>
</div>
<?php } ?>
<?php endif; ?>
<div class="clear"></div>
</header><!-- #masthead -->
<div id="main" class="wrapper">
I have removed The nav bar on this File,But i wish to use the nav bar on all my other pages.
I tried the IS page() function,but it Does not work,for me at least.Could someone provide an example on how this should be done
You need to create static "template page",
your first one would be your home page.
<?php /* Template Name: Homepage */?>
<?php get_header();?>
-- BODY HERE --
<?php get_footer();?>
Now you create how many pages you got like this, Home, About, Service, Profile, Contact.
Now you don't need a template for every single page but it wouldn't hurt I would recommend doing that.
Finally to get the different header for other page you just create a different header-other.php and use it instead of the header.php....
Make sure you use -name.php because you will call it like this on the page you want.
<?php get_header('name');?>
so anything past the - you put in here and WordPress will know that you are trying to use that HEADER.
I hope this helps and solves all your issues, best of luck with your project.
Related
I have created custom theme for wordpress - nothing complicated, just starting page, no footer, sidebar, menu. But here I have problem which I can't solve. I want to use font "Lato" from google fonts with latin extendend fonts (polish signs). As I provided proper codes in header (I think), in css, but still the result is like that: http://artystycznaperspektywa.com/
Here is header.php
<!DOCTYPE HTML>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Lato&subset=latin-ext" rel="stylesheet">
</head>
Here is index.php:
<?php get_header(); ?>
<body>
<div class="container">
<div id='logo'><img src="<?php bloginfo( 'template_url' ); ?>/img/logo.png" ></div>
<div id="intro">Dziękujemy za odwiedzenie strony Artystycznej Perspektywy. Zapraszamy do zapoznania się z naszą ofertą:</div>
<div id="select">
<div id="malarstwo">
<div class="sign1">
<div class="name1">
<img src="<?php bloginfo( 'template_url' ); ?>/img/malarstwo.jpg" >
<a class="link" href="http://artystycznaperspektywa.com/malarstwo/">Malarstwo ścienne</a>
</div>
</div>
</div>
<div id="fotografia">
<div class="sign2">
<div class="name2">
<img src="<?php bloginfo( 'template_url' ); ?>/img/fotografia.jpg" >
<a class="link" href="http://artystycznaperspektywa.com/fotografia/">Fotografia</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
And of course in css font is put in html, body.
Does someone see what can couse problems with fonts? This problem does not appear in other sites (which are made on ready theme), only on this custom theme.
Please check if selected encoding of the file index.php in your code editor is UTF-8, probably it's not, and because the charset of the page is set to UTF-8 <meta charset="UTF-8" /> this causes the problems to appear.
I am trying to edit a Worpress template. Everything work as as expected except that I wish to have a page without sidebar - which is not included in that template.
To achieve this I went to the template's folder, duplicated the "page.php" and named it page-nosidebar.php. Over there I deleted the get_sidebar call script. Here is how it looks like now:
<?php /*
Template Name: No Sidebars
*/ ?>
<?php get_header(); ?>
<div id="single_cont">
<div class="single_left">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1 class="single_title"><?php the_title(); ?></h1>
<div class="single_inside_content">
<?php the_content(); ?>
</div><!--//single_inside_content-->
<br /><br />
<?php //comments_template(); ?>
<?php endwhile; else: ?>
<h3>Sorry, no posts matched your criteria.</h3>
<?php endif; ?>
</div><!--//single_left-->
<div class="clear"></div>
</div><!--//single_cont-->
<?php get_footer(); ?>
After this, I went to the page editor and assigned this new template to the page I wanted to have no sidebar. Problem? Sidebar still shows up.
How should I do? Thanks in advance!
UPDATE
footer.php
<div class="clear"></div>
<div id="footer">
<div class="footer_text"> <?php echo date("Y"); ?> Company. Powered by Company</div>
</div><!--//footer-->
</div><!--//main_container-->
<?php wp_footer(); ?>
</body>
</html>
header.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Raleway:400,100,200' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Cabin:700' rel='stylesheet' type='text/css'> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title> <?php wp_head(); ?> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <!--[if lt IE 9]> <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script> <![endif]--> <!--<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>--> <script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery-latest.js"></script> <script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/scripts.js"></script> <script src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.infinitescroll.js" type="text/javascript" charset="utf-8"></script> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" title="no title" charset="utf-8"/> <script type="text/javascript"> $(document).ready( function($){ $('#content_inside').infinitescroll({
navSelector : "div.load_more_text",
// selector for the paged navigation (it will be hidden)
nextSelector : "div.load_more_text a:first",
// selector for the NEXT link (to page 2)
itemSelector : "#content_inside .home_post_box"
// selector for all items you'll retrieve },function(arrayOfNewElems){
$('.home_post_box').hover( function() { $(this).find('.home_post_text').css('display','block'); }, function () { $(this).find('.home_post_text').css('display','none'); } );
//$('.home_post_cont img').hover_caption();
// optional callback when new content is successfully loaded in.
// keyword `this` will refer to the new DOM content that was just added.
// as of 1.5, `this` matches the element you called the plugin on (e.g. #content)
// all the new elements that were found are passed in as an array
}); } ); </script> </head> <body> <?php $shortname = "neue"; ?> <?php if(get_option($shortname.'_background_image_url','') != "") { ?> <style type="text/css"> body { background-image: url('<?php echo get_option($shortname.'_background_image_url',''); ?>'); } </style> <?php } ?> <div id="main_container"> <div id="header"> <div class="left"> <?php if(get_option($shortname.'_custom_logo_url','') != "") { ?>
<img src="<?php echo stripslashes(stripslashes(get_option($shortname.'_custom_logo_url',''))); ?>" class="logo" /> <?php } else { ?>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/logo.jpg" class="logo" /> <?php } ?> </div>
<div class="right"> <div class="head_social">
<?php if(get_option($shortname.'_twitter_link','') != "") { ?>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/twitter-icon.png" />
<?php } ?>
<?php if(get_option($shortname.'_facebook_link','') != "") { ?>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/facebook-icon.png" />
<?php } ?>
<?php if(get_option($shortname.'_google_plus_link','') != "") { ?>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/google-plus-icon.png" />
<?php } ?>
<?php if(get_option($shortname.'_dribbble_link','') != "") { ?>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/dribbble-icon.png" />
<?php } ?>
<?php if(get_option($shortname.'_pinterest_link','') != "") { ?>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/pinterest-icon.png" />
<?php } ?>
<div class="clear"></div> </div><!--//head_social-->
<div class="header_menu"> <!--
<ul>
<li>HOME</li>
<li>ABOUT</li>
<li>CATEGORIES
<ul>
<li>Wordpress Themes</li>
<li>Create Plugins</li>
<li>Wordpress Themes</li>
<li>Create Plugins</li>
</ul>
</li>
<li>BLOG</li>
<li>CONTACT</li>
</ul>-->
<?php wp_nav_menu('menu=header_menu&container=false&menu_id='); ?>
<div class="clear"></div> </div><!--//header_menu-->
<div class="clear"></div> </div> <div class="clear"></div> <div class="tagline"> <?php echo get_option($shortname.'_header_text','Use Neue Theme Settings to update this text...') ?> </div><!--//tagline-->
</div><!--//header-->
I need to add custom urls to header. I edited Header.php and added this code:
<?php
print "<a href=localhost/URL1>URL1</a>/<a href=localhost/URL2>URL2</a>";
?> but for some reason URL1 and URL2 are not working.... Can someone help me with this problem?
EDIT: Here is header.php code
<?php
// Exit if accessed directly
if ( !defined('ABSPATH')) exit;
/**
* Header Template
*
*
* #file header.php
* #package Responsive
* #author Emil Uzelac
* #copyright 2003 - 2013 ThemeID
* #license license.txt
* #version Release: 1.3
* #filesource wp-content/themes/responsive/header.php
* #link http://codex.wordpress.org/Theme_Development#Document_Head_.28header.php.29
* #since available since Release 1.0
*/
?>
<!doctype html>
<!--[if !IE]> <html class="no-js non-ie" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 9 ]> <html class="no-js ie9" <?php language_attributes(); ?>> <![endif]-->
<!--[if gt IE 9]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php wp_title('|', true, 'right'); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php responsive_container(); // before container hook ?>
<div id="container" class="hfeed">
<?php responsive_header(); // before header hook ?>
<div id="header">
<?php responsive_header_top(); // before header content hook ?>
<?php if (has_nav_menu('top-menu', 'responsive')) { ?>
<?php wp_nav_menu(array(
'container' => '',
'fallback_cb' => false,
'menu_class' => 'top-menu',
'theme_location' => 'top-menu')
);
?>
<?php } ?>
<?php responsive_in_header(); // header hook ?>
<?php if ( get_header_image() != '' ) : ?>
<div id="logo">
<img src="<?php header_image(); ?>" width="<?php if(function_exists('get_custom_header')) { echo get_custom_header() -> width;} else { echo HEADER_IMAGE_WIDTH;} ?>" height="<?php if(function_exists('get_custom_header')) { echo get_custom_header() -> height;} else { echo HEADER_IMAGE_HEIGHT;} ?>" alt="<?php bloginfo('name'); ?>" />
</div><!-- end of #logo -->
<?php endif; // header image was removed ?>
<?php if ( !get_header_image() ) : ?>
<div id="logo">
<span class="site-name"><?php bloginfo('name'); ?></span>
<?php echo "<a href='www.google.com'>URL1</a>/<a href='www.google.com'>URL2</a>"?>;
<span class="site-description"><?php bloginfo('description'); ?></span>
</div><!-- end of #logo -->
<?php endif; // header image was removed (again) ?>
<?php get_sidebar('top'); ?>
<?php wp_nav_menu(array(
'container' => 'div',
'container_class' => 'main-nav',
'fallback_cb' => 'responsive_fallback_menu',
'theme_location' => 'header-menu')
);
?>
<?php if (has_nav_menu('sub-header-menu', 'responsive')) { ?>
<?php wp_nav_menu(array(
'container' => '',
'menu_class' => 'sub-header-menu',
'theme_location' => 'sub-header-menu')
);
?>
<?php } ?>
<?php responsive_header_bottom(); // after header content hook ?>
</div><!-- end of #header -->
<?php responsive_header_end(); // after header container hook ?>
<?php responsive_wrapper(); // before wrapper container hook ?>
<div id="wrapper" class="clearfix">
<?php responsive_wrapper_top(); // before wrapper content hook ?>
<?php responsive_in_wrapper(); // wrapper hook ?>
Ok here is code od header.php. I added custom URLs but they are not displayed on website.
You have placed the anchor tag for URL1 and URL2 in
if ( !get_header_image() )
which means it would show both the URLs only when there is no header image and if this is correct try placing the code inside
<?php if ( get_header_image() != '' ) : ?>
and also you are using the wrong form of the url you are using
<a href='www.google.com'>URL1</a>
but rather try using complete url which is
<a href='http://www.google.com'>URL1</a>
whats not working? does clicking link give 404?
if 404, then, as suggested, change href to a valid uri.
anything added to header.php will show on frontend, so only your href uri can be the issue, as far as the info you have provided for us goes.
Good Luck :)
I somehow managed to blow my Wordpress Site up; The last file I was in was my header.php, I've been combing through it for a couple hours and haven't found whats causing the break yet.
Any suggestions:
Header.php below:
<?php
/**
* #package WordPress
* #subpackage Default_Theme
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?> >
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>"/>
<meta property="fb:admins" content="1641586359" />
<title>
<?php
if($pagePtr =="home"){
print"Read It Forward";
}else if( is_search() ){
echo the_search_query(); print" - Read It Forward Search Results";
}else{
wp_title('', true, 'left');
} ?>
<?php //bloginfo('name'); ?>
</title>
<meta name="description" content="Sneak peeks at great reads, behind-the-scenes insights from authors, lively & provocative reader's guides & fabulous free books." />
<link type="text/css" href="<?php bloginfo('template_directory'); ?>/style.css" rel="stylesheet" />
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/images/rif_icon.gif" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php if (is_single()) { ?>
<meta property="og:title" content="<?php single_post_title(''); ?>" />
<meta property="og:description" content="<?php echo strip_tags(get_the_excerpt($post->ID)); ?>" />
<meta property="og:type" content="article" />
<meta property="og:image" content="<?php
if($image= get_post_meta($post->ID, "image", true)) { echo $image; }
else if($isbn= get_post_meta($post->ID, "isbn", true)) { ?>http://www.randomhouse.com/images/dyn/cover/?source=<?php echo $isbn; ?>&height=225&maxwidth=150<?php }
else { ?>
http://www.crownpublishing.com/images/readitforward/rif_square.jpg
<?php }?>" />
<?php } ?>
<link href="<?php bloginfo('template_directory'); ?>/tweet/tweet.css" media="all" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.crownpublishing.com/js/jquery.hoverIntent.minified.js"></script>
<script language="javascript" src="<?php bloginfo('template_directory'); ?>/tweet/jquery.tweet.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript" src="http://www.randomhouse.com/js/emv.js"></script>
<script language="javascript" src="<?php bloginfo('template_directory'); ?>/includes/RIFvalid.js" type="text/javascript"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" ></script>
<!--[if IE]>
<style>
.searchfield {
position:relative;
top:-1px;
}
</style>
<![endif]-->
</head>
<body>
<div id="BGcontainer">
<div id="container">
<div align="center" style="width:100%; background:#FFF;"><img src="<?php bloginfo('template_directory'); ?>/images/readitforward_ad.jpg" style="max-width:700px; border: 15px solid white"/></div>
<div id="header">
<div id="title">
<img src="http://www.osmproduction.com/RIF/wp-content/uploads/2012/02/NewRIF_logo.gif" border="0" alt="Read It Forward"><br />
<p>Sneak peeks at great reads, behind-the-scenes insights from authors, lively and provocative reader's guides, and fabulous free books</p>
<div class="clear"></div>
</div>
<div id="Hsocial">
<div id="Hscontainer">
<div class="clear"></div>
<a class="SCRIBDbutton buttonHover" href="http://www.scribd.com/document_collections/2697109"></a>
<a class="GRbutton buttonHover" href="http://www.goodreads.com/user/show/3313709"></a>
<a class="FBbutton buttonHover" href="http://www.facebook.com/ReadItForward"></a>
<a class="TWbutton buttonHover" href="http://twitter.com/readitforward"></a>
<a class="YTbutton buttonHover" href="http://www.youtube.com/user/crownbooks#g/c/CBA6E62882B7B93F"></a>
<a class="RSSbutton buttonHover" href="<?php bloginfo('rss2_url'); ?>"></a>
<div class="clear"></div>
<?php
if( function_exists('FA_display_slider') ){
FA_display_slider(64);
}
?>
</div>
</div>
<div id="searchBox">
<?php get_search_form(); ?>
</div>
<?php //MENU: http://spyrestudios.com/how-to-create-a-sexy-vertical-sliding-panel-using-jquery-and-css3/ ?>
<?php //SLIDEIN tab: http://spyrestudios.com/how-to-create-a-sexy-vertical-sliding-panel-using-jquery-and-css3/ ?>
</div>
</div>
<div align="center">
<ul id="nav" align="center">
<li class="navItem"><p class="navInfo">FREE BOOKS</p></li>
<li class="navItem"><p class="navInfo">READER REVIEWS</p></li>
<li class="navItem"><p class="navInfo">MEET THE AUTHOR</p></li>
<li class="navItem"><p class="navInfo">MEET THE EDITOR</p></li>
<li class="navItem"><p class="navInfo">BOOK GROUPS</p></li>
<li class="navItem"><p class="navInfo">FAVORITES</p></li>
<li class="navItemLast navMenu">
<p class="navInfo">ALL CATEGORIES</p>
<div align="left">
<ul class="subNavMenu">
<li><div class="subNavItem">Book Groups</div></li>
<li><div class="subNavItem">Critics Rave</div></li>
<li><div class="subNavItem">Enthusiasms</div></li>
<li><div class="subNavItem">Free Books</div></li>
<li><div class="subNavItem">Gift Guide</div></li> <li><div class="subNavItem">Living with Books</div></li>
<li><div class="subNavItem">Meet the Author</div></li>
<li><div class="subNavItem">Meet the Editor</div></li>
<li><div class="subNavItem">Reader Reviews</div></li>
<?php //wp_list_categories('orderby=name&include=3343'); ?>
</ul>
</div>
</li>
<?php /*
<li class="navItemLast navMenu"><p class="navInfo">RECENT ISSUES</p>
<ul class="subNavMenu">
<li>Test 1</li>
<li>Test 2</li>
<li>Test 3</li>
</ul>
</li>
*/?>
<?php //MENU: http://spyrestudios.com/how-to-create-a-sexy-vertical-sliding-panel-using-jquery-and-css3/ ?>
<?php //SLIDEIN tab: http://spyrestudios.com/how-to-create-a-sexy-vertical-sliding-panel-using-jquery-and-css3/ ?>
</ul>
</div>
</div>
<script>
$('.navItem').click(function() {
var newLink = $('a:first-child',this).attr("href");
if(newLink != "" && newLink != "#") {
window.location =newLink;
}
return false;
});
</script>
<script>
$('.navItem').click(function() {
var newLink = $('a:first-child',this).attr("href");
if(newLink != "" && newLink != "#") {
window.location =newLink;
}
return false;
});
</script>
UPDATE: Is there an app anywhere online to run tests for errors? I think it may be a missing closing tag somewhere, though I haven't spotted it. I've ran syntax tests against PHP 4+ on a site I found, and appears I'm OK there.
Try turning debugging on.
http://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Log
This should give you an idea of where to start. Otherwise comment out all the php code on the page. Then uncomment them line by line until you find out what causes your page to break. This is where your syntax error will be.
Also, it is a bit unclear what blow up is. It doesn't work at all? Or it works, but the page isn't displaying properly? The former case will be a php error, the latter likely a closing tag issue.
I bump into this problem:
When you go to my website: http://www.appartementtekooputrecht.nl and click on the twitter share button, it directs twitter to http://www.appartementtekooputrecht.nl/samenvatting (last page) in stead of to the homepage.
I have placed the share plugin share code in more parts of the theme, but with no good result.
Fyi in this theme all pages are displayed on the homepage.
Any help would be realy appreciated!
here is my header.php (share is at the end)
<?php global $shortname; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php elegant_titles(); ?></title>
<?php elegant_description(); ?>
<?php elegant_keywords(); ?>
<?php elegant_canonical(); ?>
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/style.css" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/ie6style.css" />
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">DD_belatedPNG.fix('img.overlay, div#content-bg-bottom');</script>
<![endif]-->
<?php wp_head(); ?>
</head>
<body>
<div id="wrapper">
<div id="content">
<div id="content-bg-bottom">
<div id="header">
<ul>
<li class="active">Home</li>
<?php query_posts(array
('post_type' => 'page',
'orderby' => get_option('myresume_nav_sort_pages'),
'order' => get_option('myresume_nav_order_page'),
'post__not_in' => get_option('myresume_nav_exclude_pages')
)); ?>
<?php if (have_posts()) : while (have_posts()) : the_post()?>
<li><?php the_title() ?></li>
<?php endwhile; endif; wp_reset_query(); ?>
</ul>
<br class="clear" />
<div id="logo">
<img class="avatar" alt="Appartement te koop Utrecht Utrecht" src="http://www.tim-productions.tv/appartementtekooputrecht.nl/wp-content/themes/MyResume/images/appartement-te-koop-utrecht-logo.jpg" />
<img class="overlay" src="<?php bloginfo('template_directory'); ?>/images/photo-overlay.png" alt="" />
<span>
<br />
<?php echo(get_option('myresume_email')) ?>
<br />
<?php echo(get_option('myresume_phone')) ?>
</span>
</div>
</div>
<div id="inside">
<div id="inside-bg-top">
<div id="inside-bg-bottom">
<div class="resume slide">
<div class="social"><?php lacands_wp_filter_content_widget(); ?></div>
And here the theme index.php
<?php get_header(); ?>
<?php query_posts(array
('post_type' => 'page',
'orderby' => get_option('myresume_sort_pages'),
'order' => get_option('myresume_order_page'),
'post__in' => get_option('myresume_exclude_pages')
)); ?>
<?php if (have_posts()) : while (have_posts()) : the_post()?>
<div class="page-content">
<div class="entry">
<?php the_content('') ?>
</div>
<h2><?php the_title() ?></h2>
</div>
<?php endwhile; endif; wp_reset_query(); ?>
<?php get_footer(); ?>
I downloaded that plugin and I can see in the code of the file "la-click-and-shared.php", around line 560, that the widget gets the links that passes to the social buttons from the permalink of the current post/page. What I can't know is why you have that permalink.
I would guess it must be a problem either with the permalink/name of the post, with the permalinks setting in general or with the AJAX functionality, but it is difficult to help you further without further details.
You could try these:
Check the permalink of that page or post you are showing as home.
Disable custom permalinks temporarily and see if it works then.
Is the Settings > Reading > Front page displays option set correctly?
Disable other plugins temporarily
Edit:
You could also edit la-click-and-shared.php. In the latest version that I just have downloaded, this is line 556:
$args['link'] = htmlentities($link1);
If you can't fix it any other way and/or you are in a hurry, you could just do:
$args['link'] = 'http://www.appartementtekooputrecht.nl';
Since your site only exposes that URL anyway it is not a big deal. But, of course, you are 'breaking' the plugin if you change your site in the future so it doesn't use AJAX (inappropriately in my opinion) to load all the pages with the same URL (no browsing history either).