Wordpress: add links to site's header.


#1

Hello!
I have a website on wordpress - s p m a s . l t
I need to add links (icons-flags) to website header (right top corner), which will be following to site’s another language version. There would be two languages: lithuanian (s p m a s . l t) and english(s p m a s . l t / en)
I want it look like this - http://pics.lt/gallery.php?entry=images/198_1.jpg
Theme- themeforest luxury 1.7.
Help! :slight_smile:


#2

So edit your header.php file and plop 'em in there.


#3

tonvie
How to edit it? I don’t know html or php.


#4

If your header is widgetized you might be able to just add a widget and use the shortcodes from something basic like this plugin: http://wordpress.org/extend/plugins/world-flags/

There are lots of great multilingual plugins out ther, like http://wordpress.org/extend/plugins/qtranslate/ and http://wordpress.org/extend/plugins/sitepress-multilingual-cms/ - you might want to look into those, though your needs sound more simplistic.

Honestly if you don’t know PHP or HTML, and there’s no plugin that does what you want out of the box, you should probably consider hiring someone to set things up for you (or else take the time to learn those languages - you would only need HTML for this and it’s very easy to learn. Just google around).

Good luck :slight_smile:


#5

Hire a freelancer to do it for you.


#6

sevenspark
Thanks for a reply. Will I need to edit .css files or only header.php?

wpCanyonThemes
I need to do it today, so I think I will NOT have time to find and hire a freelancer.


#7
bertoscool said

sevenspark
Thanks for a reply. Will I need to edit .css files or only header.php?

wpCanyonThemes
I need to do it today, so I think I will have time to find and hire a freelancer.

It depends, but most likely the CSS will need to be tweaked to make the display look its best. Without seeing the code it’s hard to say

Basically you just need images of the flags wrapped in links to the sites wrapped in a div that’s absolutely positioned within the header. Pretty straightforward.


#8

Code:
<?php
global $custom_settings;
/* Allow the overriding of custom settings array on a per post/page basis using custom fields: /
if(is_single() || is_page()) { $post_or_page_id = $post->ID; }
$data = get_post_meta($post_or_page_id, “custom_meta_values”, true);
if($data[“hide_thumbnail_on_single”])
$custom_settings[“layout”][“hide_thumbnail_on_single”] = $data[“hide_thumbnail_on_single”];
if($data[“columns”])
$custom_settings[“layout”][“columns”] = $data[“columns”];
/
------------------------------------------------------------------------------------------- */
?>

> <?php wp_title(' - ', true, 'right'); ?> <?php bloginfo('name'); ?> <?php add_action('wp_head', 'add_stylesheets'); ?> <?php //add_action('wp_head', 'add_javascript'); ?>
<?php
	// Cufon fonts - use ColaborateLight_400 as default if no other font selected.
	$font = "ColaborateLight_400.font.js"; // default
	if($custom_settings["font"]){ $font = $custom_settings["font"];	}
	echo "<!--[if lt IE 8]><script src='http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js' type='text/javascript'></script><![endif]-->";
	wp_enqueue_script('jquery'); // load new jquery
	wp_enqueue_script('cudazi_cufon',get_bloginfo('template_directory')."/js/cufon-yui.js");
	wp_enqueue_script('cudazi_fonts',get_bloginfo('template_directory')."/js/fonts/".$font);
	wp_enqueue_script('cudazi_superfish',get_bloginfo('template_directory')."/js/superfish.js");
	wp_enqueue_script('cudazi_supersubs',get_bloginfo('template_directory')."/js/supersubs.js");
	wp_enqueue_script('cudazi_cycle',get_bloginfo('template_directory')."/js/jquery.cycle.min.js");
	wp_enqueue_script('cudazi_general',get_bloginfo('template_directory')."/js/general.js");
	echo html_entity_decode($custom_settings["additional_js"], ENT_QUOTES);
?>

<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<?php wp_head(); ?>
>
<?php if($custom_settings["logo_text_based"]){ ?>

"><?php echo $custom_settings["logo_text_based"]; ?>

<?php }else{ ?> ">" alt="Logo" /> <?php } ?>
<?php if($custom_settings["search_disabled"]) { echo ""; }else{ ?>
/" method="get" class="clearfix">
<?php } ?>
                <?php wp_nav_menu( 
					array( 
						'container' => 'div', 
						'container_class' => 'menu-horizontal clearfix', 
						'menu_class' => 'sf-menu', 
						'theme_location' => 'primary', 
						'fallback_cb' => 'cudazi_fallback_menu' ) 
				); ?>
                <?php function cudazi_fallback_menu() { /* backup menu if 3.0 menu is not in use */ ?>
                    <div class="menu-horizontal clearfix">
                        <ul class="sf-menu">
                            <?php if($custom_settings["dropdown_disabled"]) { $depth = 1; } ?>
                            <?php $exclude = $custom_settings["menu_exclude"]; ?>
                            <?php wp_list_pages("title_li=&exclude=".$exclude."&depth=".$depth); ?>
                        </ul>
                    </div><!--// menu-horizontal-->
                <?php } ?>
                
			</div><!-- // grid_12-->
		</div><!--//header-->

Maybe you could write an approximate code and where it to paste. Thanks. :slight_smile:


#9

Lol :slight_smile: We’re developers, not magicians, we can’t understand a code displayed like that. :slight_smile:


#10

Sorry :slight_smile:
Code - http://pastebin.com/kvtyBr8n


#11
bertoscool said

Sorry :slight_smile:
Code - http://pastebin.com/kvtyBr8n

Probably inside the #header div (around line 44-45 - possibly inside .grid_8 depending on how it’s styled). Your basic structure is this:

Then add a CSS style something like this:

#flaglinks{
  position:absolute;
  top:0px;
  right:0px;
}

You might need to set the width, too, but that’s your basic structure. Hope it helps :slight_smile:

P.S. Get firebug, it’ll help http://getfirebug.com


#12

sevenspark
Thanks! I will try it and write here if it works. :slight_smile:


#13
bertoscool said

Code:
<?php
global $custom_settings;
/* Allow the overriding of custom settings array on a per post/page basis using custom fields: /
if(is_single() || is_page()) { $post_or_page_id = $post->ID; }
$data = get_post_meta($post_or_page_id, “custom_meta_values”, true);
if($data[“hide_thumbnail_on_single”])
$custom_settings[“layout”][“hide_thumbnail_on_single”] = $data[“hide_thumbnail_on_single”];
if($data[“columns”])
$custom_settings[“layout”][“columns”] = $data[“columns”];
/
------------------------------------------------------------------------------------------- */
?>

> <?php wp_title(' - ', true, 'right'); ?> <?php bloginfo('name'); ?> <?php add_action('wp_head', 'add_stylesheets'); ?> <?php //add_action('wp_head', 'add_javascript'); ?>
<?php
	// Cufon fonts - use ColaborateLight_400 as default if no other font selected.
	$font = "ColaborateLight_400.font.js"; // default
	if($custom_settings["font"]){ $font = $custom_settings["font"];	}
	echo "<!--[if lt IE 8]><script src='http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js' type='text/javascript'></script><![endif]-->";
	wp_enqueue_script('jquery'); // load new jquery
	wp_enqueue_script('cudazi_cufon',get_bloginfo('template_directory')."/js/cufon-yui.js");
	wp_enqueue_script('cudazi_fonts',get_bloginfo('template_directory')."/js/fonts/".$font);
	wp_enqueue_script('cudazi_superfish',get_bloginfo('template_directory')."/js/superfish.js");
	wp_enqueue_script('cudazi_supersubs',get_bloginfo('template_directory')."/js/supersubs.js");
	wp_enqueue_script('cudazi_cycle',get_bloginfo('template_directory')."/js/jquery.cycle.min.js");
	wp_enqueue_script('cudazi_general',get_bloginfo('template_directory')."/js/general.js");
	echo html_entity_decode($custom_settings["additional_js"], ENT_QUOTES);
?>

<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<?php wp_head(); ?>
>
<?php if($custom_settings["logo_text_based"]){ ?>

"><?php echo $custom_settings["logo_text_based"]; ?>

<?php }else{ ?> ">" alt="Logo" /> <?php } ?>
<?php if($custom_settings["search_disabled"]) { echo ""; }else{ ?>
/" method="get" class="clearfix">
<?php } ?>
                <?php wp_nav_menu( 
					array( 
						'container' => 'div', 
						'container_class' => 'menu-horizontal clearfix', 
						'menu_class' => 'sf-menu', 
						'theme_location' => 'primary', 
						'fallback_cb' => 'cudazi_fallback_menu' ) 
				); ?>
                <?php function cudazi_fallback_menu() { /* backup menu if 3.0 menu is not in use */ ?>
                    <div class="menu-horizontal clearfix">
                        <ul class="sf-menu">
                            <?php if($custom_settings["dropdown_disabled"]) { $depth = 1; } ?>
                            <?php $exclude = $custom_settings["menu_exclude"]; ?>
                            <?php wp_list_pages("title_li=&exclude=".$exclude."&depth=".$depth); ?>
                        </ul>
                    </div><!--// menu-horizontal-->
                <?php } ?>
                
			</div><!-- // grid_12-->
		</div><!--//header-->

Maybe you could write an approximate code and where it to paste. Thanks. :slight_smile:

oh ! now everyone see your password !

question: you say you don’t know php or similar (so you aren’t developer), why don’t you have that icon “bought between x and x items”


#14
ewizz said

oh ! now everyone see your password !

question: you say you don’t know php or similar (so you aren’t developer), why don’t you have that icon “bought between x and x items”

I honestly don’t think this theme is from themeforest … :wink:


#15

sevenspark
Thanks! It worked!!! :)))

ewizz
What passwords? So you can find my admin password?

Sorry, I didn’t understand your question about icon. :slight_smile:

Bebel
It is - http://themeforest.net/item/luxury-wordpress-template/full_screen_preview/83220 :slight_smile:


#16
bertoscool said

sevenspark
Thanks! It worked!!! :)))

ewizz
What passwords? So you can find my admin password?

Sorry, I didn’t understand your question about icon. :slight_smile:

Bebel
It is - http://themeforest.net/item/luxury-wordpress-template/full_screen_preview/83220 :slight_smile:

ewizz’s question is that it is obvious that you have not purchased that theme through the account you are posting with. Perhaps you could post back here with the account you used to purchase the theme and ease our minds? :slight_smile:


#17

sevenspark
It purchased my friend to whom I help doing that website. He did it some months ago and I asked him to give me acc to write here, however he lost it. So I can’t provide the acc he bought this theme.


#18

Ok, everything is fine. Please delete this topic, I don’t want google to index it. thanks for help!


#19

Nope it is not, but it is helping others.