External link in nav bar
-
Hi,
I have trouble linking to a forum on my website that’s not part of WordPress. Before, I used to use the redirectify plugin but it doesn’t seem to work anymore (probably because it’s no longer compatible with the new version of WordPress). I’ve tried everything, even creating a page and then trying to change it’s link in the database, however, even that doesn’t seem to work!
Thanks, help most appreciated!
Ian
-
Hi there, can you post the code of your templates header file in here please?!
Hi, I’m not sure I understood you correctly? you mean all the stuff inside header.php of my current theme (I’m using K2)?
Thanks,
IanHi, yes copy all the code in the header and post it here… and I will show you how to add a link in there.
Hi, Here’s the code:
<?php // Prevent users from directly loading this theme file defined( 'K2_CURRENT' ) or die ( 'Error: This file can not be loaded directly.' ); // Load localizatons load_theme_textdomain('k2_domain'); // Load our scripts wp_enqueue_script('k2functions'); if (get_option('k2rollingarchives') == 1) { wp_enqueue_script('k2rollingarchives'); } if (get_option('k2livesearch') == 1) { wp_enqueue_script('k2livesearch'); } if ((get_option('k2livecommenting') == 1) and ((is_page() or is_single()) and (!isset($_GET['jal_edit_comments'])) and ('open' == $post-> comment_status) or ('comment' == $post-> comment_type) )) { wp_enqueue_script('k2comments'); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <head profile="https://gmpg.org/xfn/11"> <title><?php // Page or Single Post if ( is_page() or is_single() ) { the_title(); // Category Archive } elseif ( is_category() ) { printf( __('Category Archive for ‘%s’','k2_domain'), single_cat_title('', false) ); // Tag Archive } elseif ( function_exists('is_tag') and function_exists('single_tag_title') and is_tag() ) { printf( __('Tag Archive for ‘%s’','k2_domain'), single_tag_title('', false) ); // General Archive } elseif ( is_archive() ) { printf( __('%s Archive','k2_domain'), wp_title('', false) ); // Search Results } elseif ( is_search() ) { printf( __('Search Results for ‘%s’','k2_domain'), attribute_escape(get_search_query()) ); } // Insert separator for the titles above if ( !is_home() and !is_404() ) { _e(' at ','k2_domain'); } // Finally the blog name bloginfo('name'); ?></title> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <meta name="template" content="K2 <?php k2info('version'); ?>" /> <meta name="description" content="<?php bloginfo('description'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo get_template_directory_uri(); ?>/style.css" /> <?php if ( ! K2_USING_STYLES ): /* WP Theme Stylesheet */ ?> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo get_stylesheet_uri(); ?>" /> <?php elseif ( get_option('k2style') != '' ): /* K2 Styles */ ?> <link rel="stylesheet" type="text/css" href="<?php k2info('style'); ?>" /> <?php endif; ?> <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" /> <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" /> <?php if ( is_single() or is_page() ): ?> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php endif; ?> <?php wp_head(); ?> <script type="text/javascript"> //<![CDATA[ <?php if ( 1 == get_option('k2dynamiccolumns') ): ?> K2.columns = <?php echo get_option('k2columns') ?>; K2.layoutWidths = <?php /* Style Layout Widths */ if ( ! K2_USING_STYLES ) { echo '[580, 800, 970]'; } else { $styleinfo = get_option('k2styleinfo'); if ( empty($styleinfo['layout_widths']) ) echo '[580, 800, 970]'; else output_javascript_array($styleinfo['layout_widths']); } ?>; if (K2.columns > 1) { jQuery(document).ready(dynamicColumns); jQuery(window).resize(dynamicColumns); } <?php endif; ?> <?php /* Debugging */ if ( isset($_GET['k2debug']) ): ?> K2.debug = true; <?php endif; ?> jQuery(document).ready(function(){ <?php /* LiveSearch */ if ( '1' == get_option('k2livesearch') ): ?> K2.LiveSearch = new LiveSearch( "<?php if (get_option('k2rollingarchives') == 1) { output_javascript_url('rollingarchive.php'); } else { output_javascript_url('theloop.php'); } ?>", "<?php echo attribute_escape(__('Type and Wait to Search','k2_domain')); ?>" ); <?php endif; ?> <?php /* Rolling Archives */ if ( '1' == get_option('k2rollingarchives') ): ?> K2.RollingArchives = new RollingArchives( "<?php output_javascript_url('theloop.php'); ?>", "<?php echo attribute_escape(__('Page %1$d of %2$d',k2_domain)); ?>" ); <?php endif; ?> }); <?php /* Live Comment */ if ( ( '1' == get_option('k2livecommenting') ) and ( ( is_page() or is_single() ) and ( !isset($_GET['jal_edit_comments']) ) and ( 'open' == $post->comment_status ) or ( 'comment' == $post->comment_type ) ) ): ?> K2.ajaxCommentsURL = "<?php output_javascript_url('comments-ajax.php'); ?>"; <?php endif; ?> //]]> </script> <?php wp_get_archives('type=monthly&format=link'); ?> </head> <body class="<?php k2_body_class(); ?>"> <?php /* K2 Hook */ do_action('template_body_top'); ?> <a class="skiplink" href="#startcontent" accesskey="2"><?php _e('Skip to content','k2_domain'); ?></a> <div id="page"> <?php /* K2 Hook */ do_action('template_before_header'); ?> <div id="header"> <h1 class="blog-title"><a href="<?php echo get_settings('home'); ?>/" accesskey="1"><?php bloginfo('name'); ?></a></h1> <p class="description"><?php bloginfo('description'); ?></p> <?php /* K2 Hook */ do_action('template_header'); ?> </div> <!-- #header --> <hr /> <?php /* K2 Hook */ do_action('template_before_content'); ?>
Thanks so much!
Ian
Try to do this:
Under this:
<h1 class="blog-title"><a href="<?php echo get_settings('home'); ?>/" accesskey="1"><?php bloginfo('name'); ?></a></h1>
add:
<h1><a href="https://www.yoursiteurl.com" accesskey="1"></a></h1>
Nope,
Nothing. However I’ve noticed something. I’m using Firebug and for some reason h1 is greyed out (ie: not showing on the page) I wonder why?
Thanks again for your support,
IanOh wait just remembered:
I had set (in the K2 options) to not show the blog title and description. That’s <h1>. So that’s why it’s not showing, however on Firebug I’ve noticed that every menu item is placed in
<ul class="menu">
Hope that helps,
Thanks
- The topic ‘External link in nav bar’ is closed to new replies.