Posted by The Doctor on Dec 13, 2009 with
No Comments |
Short Link
Last modified by The Doctor on March 17, 2010
in
Tips
as
bloginfo,
settings,
tagline,
WordPress
I have noticed on many blogs the description usually found under the blog title is:
Just another WordPress weblog
This may be the case, or it may not, but for the most part this tagline can be customized to better suit the blog itself. It is just a matter of making a change in the Settings of the blog; and, it is this easy:
- Log into your Dashboard (admin pages)
- Click on the Settings option, which defaults to display the General Settings
- Beside “Tagline”, in the box, type what you want your new blog description to be
- Scroll to the bottom of the page and click the “Save Changes” button
That’s it! Your blog is no longer “Just another WordPress weblog”, it is your weblog now!
Bonus:
How does WordPress display the Tagline?
Most themes display the blog description with something similar to the following code:
<?php bloginfo( 'description' ) ?>
Now, if you do not want to display your blog’s description you can do one of the two following things:
- Go into your Settings and clear the text from the Tagline box, or
- Go into your theme’s code and using the ‘//’ for commenting, make a change like this:
<?php // bloginfo( 'description' ) ?>
Posted by The Doctor on Nov 25, 2009 with
1 Comment |
Short Link
Last modified by The Doctor on March 17, 2010
in
Functions
as
bloginfo,
get_bloginfo,
WordPress,
wp_list_categories,
wp_list_pages,
wp_page_menu
Creating text links back to the home page, or front page, of a blog are done in many ways. Many themes use the blog Title as a link back to the home page. It is also very common for the menu or navigation bar to link to the home page. This article will cover some examples of links for going home.
Let’s start with an obvious example: a link from the blog title back to the home page.
<a href="http://wpfirstaid.com/">WP First Aid</a>
The above example is very, very basic … let’s dress it up a bit:
<h1 class="blog-title"><a href="http://wpfirstaid.com/" alt="Going Home: WP First Aid">WP First Aid</a></h1>
Now we have a title using the h1 element and a CSS class of blog-title with some alt text letting the reader know where the link will be going. This is better but how does this help you? Let’s make use of WordPress’ built in functions to make this example more generic and easily transferable.
<h1 class="blog-title"><a href="<?php bloginfo('url'); ?>" alt="Going Home: <?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
This example makes use of the WordPress function bloginfo(). Here is a link to the WordPress codex for this function; and, here is a link to the get_bloginfo() function which provides additional details.
Our next example is adding a home page link to a navigation bar. Many navigation bars are generated with one of three WordPress functions: wp_list_pages(), wp_page_menu(), or wp_list_categories(). The wp_page_menu function uses a value that creates a home page link, for example:
<?php wp_page_menu('show_home=1'); ?>
The wp_page_menu function includes all the available parameters of the wp_list_pages function and also includes wrapping the output in an unordered list.
To add a home page link into a theme using the wp_list_pages function you may look at the following example for guidance:
<ul>
<li><a href="<?php bloginfo('url'); ?>" alt="Going Home: <?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></li>
<?php wp_list_pages(); ?>
</ul>
Adding a home page link to a navigation menu created with the wp_list_categories function is very similar. Let’s take a quick look at it below.
<ul>
<li><a href="<?php bloginfo('url'); ?>" alt="Going Home: <?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></li>
<?php wp_list_categories(); ?>
</ul>
The only difference in the above two examples are the function call. The links we added to the home page are almost identical to the the link example we used for the blog title.
Feel free to use any of the above examples in your own works. Of course, there could be additional CSS elements needed to work with your theme’s style but I will leave that as an exercise for you … or feel free to contact us with more complex code requirements.