First lets install some plugin to show the latest tweets in wordpress. The plugin that I used is this one: http://wordpress.org/extend/plugins/twitter-for-wordpress/
You can use any plugin.
Install and put the widget in some position.
Here is an example of the output needed for the jQuery to work correctly:
<div>
<p>A tweet is here</p>
<p>Another tweet here</p>
<!-- cont... -->
</div>
Read more…
How to determine if the user is viewing the front page
Joomla 1.0
In Joomla! 1.0.x it was possible to determine if the user was viewing the front page by using code like this:
<?php
if ($option == 'com_frontpage' || $option == '') {
echo 'This is the front page';
}
?>
Joomla 1.5
But in Joomla! 1.5.x the com_frontpage component is no longer present. This is how to achieve the same result in Joomla! 1.5.x
<?php
$menu = & JSite::getMenu();
if ($menu->getActive() == $menu->getDefault()) {
echo 'This is the front page';
}
?>
This works by checking to see if the current active menu item is the default one.
Joomla 1.6, 1.7 and 2.5
This is one of the ways:
<?php if (JRequest::getInt('Itemid') == your_id) : ?>
<!-- special javascript -->
<?php endif; ?>
There are some differences in 1.6/1.7/2.5 to avoid Strict Standards errors. Use the following code for a site where all content is in the same language:
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault()) {
echo 'This is the front page';
}
?>
For multi-lingual sites the front page is dependent on the currently selected language, so you will need to use code like this:
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault( 'en-GB' )) {
echo 'This is the front page';
}
elseif ($menu->getActive() == $menu->getDefault( 'fr-FR' )) {
echo 'Accueil';
}
?>
For multi-lingual sites, it could also be necessary to display a specific code/html for all Default Home pages.
A great plugin to add a sitemap to your WordPress site – HTML Page Sitemap
The only limitation is that it shows only pages, not posts.
To do this add another page template in your theme’s folder.
You could create a Page (Write > Write Page) called…, that just uses a custom Page template implementing query_posts().
I do something similar on my site but don’t list every post! Just the categories with description and such. However, one can combine the idea of a Category Page with what I do on my ‘Archive’ Page:
Sometimes the function wp_query(); brakes the pagination, so if this hapens use this code insted:
<?php $limit = get_option('posts_per_page');
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('showposts=' . $limit . '&paged=' . $paged);
$wp_query->is_archive = true;
$wp_query->is_home = false; ?>
Notes:
$limit is assigned the ‘posts_per_page’ option from your WordPress settings, but can be changed to something else if you like:
$limit = 20;
These:
$wp_query->is_archive = true; $wp_query->is_home = false;
after the query_posts() are important as they force posts_nav_link() (and so pagination) to work, along with a few other helpful results gained for fooling WordPress into thinking we’re in the archive pages.
For the $paged stuff, see:
http://wordpress.org/support/topic/57912#post-312858
For more info: http://wordpress.org/support/topic/querying-all-posts