adding a custom link to a wordpress site - wordpress

I have a wordpress menu plugin that comes with a theme, unfortunately the theme was limited in that, it did only provide on menu, I wanted to add another menu to it. I have found where I wanted to add my link in the theme. I found that one menu provided by the theme
<li>
</i> <?php _e('gallery', 'thematic'); ?>
</li>
And duplicated that twice, but the problem if the link takes me to a page http://foo.bar/?author=1
Is there anyway I can modify this link so it takes me to a page found http://foo.bar/playground ?

Can you change the href attribute of the link?
<li>
<i class="icon-suitcase5"></i> <?php _e('gallery', 'thematic'); ?>
</li>

Related

How to open wordpress post in new tab

I'm using Hoot Business Theme, i can't find where I can insert target_blank" there is no loop.php in this theme. Is there any other way to open wordpress post in new tab?
The simplest way to achieve this without messing about in your template files is with jQuery:
$('a.addSomethingBlogSpecificHere').attr('target','_blank');
You need to add target="_blank" in anchor tag HTML like :
<a href="#" target="_blank" > Label Name </a>

Creating Drop-Down Menu For Custom Wordpress Theme

I'm trying to build a Wordpress theme from scratch. The drop down menu isn't appearing, although I added the list pages tag. Here is the code I'm using for the wp_nav_menu function.
<?php wp_head(); ?>
</head>
<body>
<div class="nav">
<div class="container">
<ul class="pull-left">
<li class="cursive">Mu Alpha Theta</li>
</ul>
<?php wp_nav_menu( array('menu' => 'Menu' )); ?>
</div>
</div>
The pages appear on the site's menu; however, they aren't merging into a drop-down. I'm wondering if it has something to do with the CSS. As in, do I have to create a structure for how it would look? Or, I'm thinking that I'm misusing th wordpress function.
Thank you for reading my questions. I would love to hear any advice.
If it's placing, but not as you want (in a drop down) it would seem to be a css issue. There are many arguments you can parse to the function outlined here in the codex. From there it's just using the id's/classes and css to get the display you're looking for.
Also, from that codex page:
Note: As of 3.5, if there are no menu items, no HTML markup will be
output.
So ensure there is some items in your menu as well, even for testing.
Depending on how fancy you want to be, you may need a custom Walker. Caveat emptor: they are not for the faint of heart.

WordPress Active Tabs

In my WordPress theme I included the following in the header.php for the menu:
<li>About Us</li>
<li>Contact</li>
However when I include the following code in the about us template:
<?php /* Template Name: About Us */ ?>
<?php $about = "active"; ?>
<?php get_header() ?>
The tab doesn't become "active", though if I include the code snippet $about = "active"; in the header.php file it works. Why is this? Is there an easier way to do this?
This probably has to do with the fact that the get_header() function isn't aware of the $about variable. This has to do with the PHP variable scope.
The way I solved this is by using the Wordpress API to generate a menu. This way, each page will automatically detect if it's the 'active' page and add that class to its relevant menu item.
I'd also suggest you to make your menu dynamic using wp_nav_menu(). However if you do not wish to use wp_nav_menu(), you could also make the menu items active using the page id in header.php

Two links for one menu item in wordpress?

I am making a site for a client and they would like a navigation item that has two words linking to two different places. The item is the last one, "twitter/facebook", to the right. Any ideas? http://pixinkdesign.com/clients1/TedX/
Thanks!
You can simply add the links to your template and style as required. They're not page of your site anyway so a simple link in the template should suffice.
Login to your admin panel and go to:
Appearance > Editor
and open up the Header.php file.
You'll see something like:
<ul id="menu">
<?php wp_list_pages('title_li='); ?>
</ul>
Which you can simply add to for your needs:
<ul id="menu">
<?php wp_list_pages('title_li='); ?>
<li>
Twitter
Facebook
</li>
</ul>

How to get wordpress plugin "Twitter hash" to show on page

I cannot for my life figure out how to get the downloaded plugin Twitter hash (http://wordpress.org/extend/plugins/twitter-hash-tag-widget/) to show on my index.php page. Read about it and this HTML code was given as an example in many places:
<li id=”twitter">
<ul>
<li><a href=”http://www.site1.com/”>Site One Name</a></li>
</ul>
</li>
But obviously all it does is a HTML list so it shows nothing of how to connect to the widget I have. I also added the file functions.php with the following lines:
<?php
if ( function_exists('register_sidebar') )
register_sidebar();
?>
and dragged the widget to its place on the wordpress widget page.
All help appreciated for a very new wordpress user!
//Margareta
Right, solved it by using the Kubrick theme instead of the simplified theme that I had used earlier. Now it is showing on the side without me doing anything. Great stuff!

Resources