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

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!

Related

bootstrap menu repeated on several html static web pages

I'm building a simple static website with Foundation.
I'm wondering how I can code the menu navigation of site without repeating the menu code on each html page (so it is easier to maintain in the future)? I could do a Javascript include with the menu but I wouldn't be able to change the navigation class appearance for each menu item (ex.: highlight "About Us").
Or is there a tool out there that would help to maintain a large menu items on a pure static web site?
I actually just tried to figure this out recently, although I ended up using PHP. If you want to use PHP, here is the following snippet I used:
Create a function
<?php
function echoActiveClassIfRequestMatches($requestUri) {
$current_file_name = basename($_SERVER['REQUEST_URI'], ".php");
if ($current_file_name == $requestUri)
echo 'class="active"';
}
?>
Then, add these to your <li> tags:
<li <?php echoActiveClassIfRequestMatches("about-us")?>>
About Us</li>
Hope this helps. I'll try to give credit if I can find the link where I found this solution.

Permalink-safe way to link pages inside footer.php

I am currently building a new theme for my site and am kind of stuck not knowing the proper way to link pages together. What is the proper way to direct visitor to another page if I were to write the link straight into footer.php?
Let's consider the following inside footer.php:
?>
A Link
<?php
That would work well up until I were to change my permalink structure to something else.
What is the proper way to do it(without using WP built in menus or anything similar)?
You can use get_permalink assuming your pages are in Wordpress.
See this link: http://codex.wordpress.org/Function_Reference/get_permalink
The above answer is 100% correct, but to save people some time when they stumble upon this question, I took the liberty of writing it out.
<?php echo get_the_title(12); ?>
This covers everything from hover text to dynamic page title, so if you decide to change "Contact" to "Contact Us," you won't have to remember to update the footer.php file.

how to have wordpress comments functionality on every page

i am new to wordpress , i was given a task to convert a web site into wordpress. Following is what i have done.
i changed the header of twentyten theme and added lot of javascript lib which were included on the original page.
i changed the index.php page and added the tables and divs so that site can have look and feel what it had before.
After reading bit of codex. i added the following at the bottom of the page to show wordpress comments.
<?php
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*/
get_template_part( 'loop', 'index' );
?>
</div><!-- #content -->
</div><!-- #container -->
Till here every thing works fine and wordpress is show comments on this page as well. Now in the menu there is another page called next_level.php so i thought to display the commenting functionality of wordpress at the bottom of that page as well. so what i did as follows.
i included the same get_header() in the next_level.php page so that header source remains the same.
i had few database queries running to display this page contents and for that i imported few tables from the previous site into the wordpress database. working fine.
The only problem i have is to show a commenting machenism of wordpress at the bottom of this page. Please guide,correct,suggest and help how to achieve this. Sorry for the long post.
Hey, I couldn't really understand the process you did or the result required, but I think this is the only line you need to display the comments at the bottom:
<?php comments_template( '', true ); ?>

modify BuddyPress adminbar only in admin pages

I have modified the buddypress admin bar by creating the following plugin which adds a simple text link to the bar:
function bp_adminbar_currentsite_menu() {
global $bp;
?>
<li>
<!-- Insert your link url or relative url, and your link text below -->
EXAMPLE LINK TEXT
</li>
<?php
}
// Call The Function Above
add_action('bp_adminbar_menus', 'bp_adminbar_currentsite_menu', 999);
However, I do NOT want the above link to be shown when logged into the wordpress admin backend (so for example when an admin is editing a post). I thought about just doing a php_self check to see if it contained "/wp-admin/" but figured that there has to be a more elegant wordpress/buddypress hook here.
How can I get the above code to only show when you are viewing a normal blog page, NOT in the admin area?
Thanks
using is_admin() is the answer. It is a wordpress function that checks to see if you are looking at admin pages or not.

widgets_on_pages not working

Hello i'm using widgets_on_pages to place widgets on pages, i installed it and added a widget to the panel in my admin section, then i added [widgets_on_pages id=2] ("its the 2nd sidebar and it said i should add this") into my html on the place where the widget should appear but it only shows the code i added in pure text, nothing else happens, anyone know what i'm doing wrong?
If I understand correctly then the following applies... if not, apologies.
You should not need to do it this way. It seems that Vincent, you are trying to add the shortcode into a theme php file... this is incorrect and the shortcode is for adding into the page/post content by the post/page editor.
To add a Widgets on Pages sidebar to a template then v 0.0.7 (I believe) has built in template tags (see link text). This should allow you to add the following I think
<?php widgets_on_template("2"); ?>
Try this
<?php echo do_shortcode('[widgets_on_pages id=2]'] ?>

Resources