Codex tools: Log in / create account
The following are articles that will help you troubleshoot and solve many of your CSS problems:
There are a variety of WordPress Plugins that change the look, layout, and colors of your comments and comment form. Look for various Comments Plugins in the Official WordPress Plugin Directory.
To change the look of the Popup Comments window in WordPress version 1.5, make changes to the comment-functions.php file where it shows the following line: function comments_popup_script($width=400, $height=400, $file=) {.
To change the look of the Popup Comments window in WordPress version 1.2.1 Mingus, make the following change to the template-functions-comment.php on line 50:
function comments_popup_script($width=400, $height=400, $file='wp-comments-popup.php')
You can also change Line 81 of wp-comments-popup.php to alter the textarea size for people entering comments.
Two tags are involved in generating your category list. For more information on setting the order and look of these see list_cats() and wp_list_cats().
Opening links in a new window is considered bad form in today's web as it has been abused. Yet, it still serves a purpose for demonstration sites that require more than one window open at a time. This method will work for those links that you enter into the body of a post.
After entering the link using the Quicktags button for "link", add target="_blank" to the individual*- link you want to have open in a new window when clicked. Consider adding text indicating that this link will open a new window, as required by web accessibility standards.
<a href="http://example.com/page.php" title="Page Title - opens in new window" target="_blank"> Page Title (Opens in new window)</a>
The article Writing Code in Your Posts will help you write programming code and code examples in your posts. The Encode tool will convert your HTML/XHTML code into a form that can be displayed on your blog without it being treated as HTML by browsers.
There are also WordPress Plugins and other tools available to help integrate this proces into your site if you use it frequently to display code.
Also see: Fun Character Entities
DropCaps is the name for the effect where the first letter of the first paragraph in an article drops below the line of text, and is displayed in a larger font-size than the other normal letters.
This can be done using BBCode quicktags. First, add this to your style sheet:
#fp:first-letter {
font-size : 300%;
font-weight : bold;
float : left;
margin-right: 3px;
}
then add following code to file /wp-includes/js/quicktags.js and put them among edButtons:
edButtons[edButtons.length] =
new edButton('ed_capdrop'
,'CapDrop'
,'<p id="fp">'
,'</p>'
,'c'
);
You will now see a CapDrop quicktag in your edit window.
See also:
See CSS
To show only the title of posts on the weblog homepage, in index.php replace
<?php the_content(); ?>
With something like:
<?php
if (is_single()) {
the_content();
}
else {//no content, nothing.
}
?>
This will show the post content only on the individual posts page.
In WordPress 1.5 and later, you have the option to rate the links in your Link Manager (Blogroll) and display the ratings for the world to see.
To rate your links, edit the particular link (by using the "Links" editing interface, or "Blogroll" in later versions of WordPress -- rating is in the Advanced section), and rate the link from 0 - 10 using the dropdown menu.
To get your link ratings to display, you may need to edit your Theme. See the documentation for the wp_list_bookmarks() or get_links() Template Tags for more information.
In WordPress 1.2, the procedure is slightly different. First, for each link category, you have to turn on the display of link ratings (Links -> Link Categories -> Show -> Rating).
Once that is done, you can display the ratings by changing the settings in the Options -> Link Manager screen:
An excerpt should not be confused with the teaser which refers to the first few sentences or paragraphs of a post. When typing a long post you can insert the <!--more--> Quicktag after a few sentences to act as a cut-off point. When the post is displayed on a category page, archive page, or home page, the teaser is displayed, followed by a hyperlink (such as Read the rest of this entry...). Your visitor can then click on that link to see the full version of your post.
Note that some Themes do not support the more ability. More information on how to present the more information can be found at Template Tag the_content() and Customizing the Read More.
As stated before, recognize that use of the more feature should not be confused with the Excerpt field in your Administration > Write > Write Post Panel. The Template Tag the_excerpt() can be used to access the contents of this field (i.e. the excerpt you enter in your blog will not be used for anything unless you have the_excerpt in your theme, or you choose to include excerpts only in your RSS fields).
To add a favicon to your site in WordPress 2.0, place your favicon.ico file inside your theme folder (for example: wp-content/themes/default/) then add this line to header.php:
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" />
Be sure to add it somewhere within the <head></head> section.
See Creating and Installing a Favicon For more detailed instructions.
Buttons are like badges you display on your website to show your affection for something, or to display information regarding your cultural, social, political or technical leanings.
To add a WordPress button to your site showing support for the WordPress Community:
For more buttons, see:
WordPress by default only produces very limited code after uploading a picture. If you want to get code for the thumbnail link, the thumbnail etc, autogenerated, the following resources will be useful, including a possible hack that may not work for WordPress v1.5 at Thumbnail HTML addition for upload.php.
See also:
See also:
See also:
You can use absolute or relative URI/URLs addresses.
To use a relative link, set the address from the root folder of your site by using a slash in front of the folder in the root directory.
<img src="/images/balloons/image.jpg" alt="balloons" />
To use an absolute link:
<img src="http://www.example.com/images/balloons/image.jpg" alt="balloons" />
When using the default theme, you'll notice images (and links) do not appear when visiting category and archive query pages. This has to do with how the default theme displays post content in those sections of your blog. To change this behavior, edit the default theme's Archive Template (archive.php). You can do this online through the Theme Editor, or offline by downloading and opening the default theme's archive.php in any text editor. Once in the Archive Template, look for this section:
<div class="entry">
<?php the_excerpt() ?>
</div>
Here, change the_excerpt() template tag, which displays a summary of a post's content while filtering out all HTML tags. To display each post's whole content (and HTML tags), use the_content() template tag:
<div class="entry"> <?php the_content(); ?> </div>
See also:
You set the Default Time Format for your blog via the Administration > Settings > General under the Date and Time section.
See also:
To put the date and time on every post title on your site, you may have to change more than one template file. They may include index.php, single.php, category.php, and archives.php.
From among the various template files, find all references to the title of your post like this (your Theme version may be slightly different):
<h2>
<a href="<?php the_permalink() ?>" rel="bookmark"
title="Permanent Link to <?php the_title(); ?>">
<?php the_title(); ?></a>
</h2>
<small>
<?php the_time('F jS, Y') ?> by <?php the_author() ?>
</small>
Rearrange it so the time information goes in front (or in back) of your Post Title:
<h2>
<a href="<?php the_permalink() ?>" rel="bookmark"
title="Permanent Link to <?php the_title(); ?>">
<?php the_time('F jS, Y') ?> - <?php the_title(); ?></a>
</h2>
<small>
by <?php the_author() ?>
</small>
See also:
The title of your links includes text that explains what the link is to, in concordance with web accessibility standards. By default, your title may look like this example, which uses the title attribute with the words "Permanent Link to" and the template tag that displays the title of the post.
<h2> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <?php the_title(); ?></a> </h2>
To change the "Permanent Link to" text, simply delete it and replace it with your own words:
<h2> <a href="<?php the_permalink() ?>" rel="bookmark" title="Post about <?php the_title(); ?>"> <?php the_title(); ?></a> </h2>
Or remove it completely, leaving only the title tag.
<h2> <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"> <?php the_title(); ?></a> </h2>
In some cases it may be necessary to change index.php.
Find this line:
<?php list_cats(0, 'All', 'name'); ?>
and replace it with this line instead:
<?php list_cats(0,'','name','','',true,0,1,1,1); ?>
See also:
In some cases it may be necessary to change index.php.
Find this line:
<?php list_cats(0, 'All', 'name'); ?>
and replace it with this line instead:
<form action="<?php echo $PHP_SELF ?>" method="get"> <?php dropdown_cats(); ?> <input type="submit" name="submit" value="view" /> </form>
See also:
Use the following function to list your categories but exclude category 1:
<?php wp_list_cats('exclude=1'); ?>
Of course, change the 1 to the ID of the category you want to exclude.
To exclude multiple categories, use this:
<?php wp_list_cats('exclude=1, 2'); ?>
Change 1 and 2 to the categories you want excluded. You can exclude more of them by adding their IDs separated by commas.
See also:
If you need to exclude a category from the front page, you can place code that does the exclusion inside The Loop of your theme's index.php file.
The Loop starts something like this:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
To exclude category 4 from the front page, just inside The Loop, add this condition :
<?php if ( !(in_category('4')) || !is_home() ) { ?>
<!-- Output the post here -->
The Loop ends something like this:
<?php endwhile; ?>
Just before that line, add this:
<?php } ?>
In the end, it will look like:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if ( !(in_category('4')) || !is_home() ) { ?>
<!-- Output the post here -->
<?php } ?> <?php endwhile; ?>
This means that if on the front page, the post will be presented if it's not in category 4. On pages other than the front ( home ) page, all posts are presented.
See also:
Put this code into your index.php where you wish the item to appear:
<li id="archives">Archives:
<ul>
<li><form name="archiveform" action="">
<select name="archive_chrono" onchange="window.location =
(document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">
<option value=''>By Month</option>
< ?php get_archives('','','option', 1); ?>
</></select>
</form>
</li>
</ul></li>
See also:
Make sure that you have the correct settings in the Show at most posts or days fields in the Administration > Settings > Reading Panel.
If you are not seeing all your entries and you modified the default index.php, make sure you have an equal number of opening and closing tags, and that they are in the right places.
See also:
In the simplest of terms, they "print" what you tell them to do. They are abbreviations for the PHP term "echo" which displays text. In WordPress, they are used to identify strings in the php files marked for translation to other languages, and localization using two "tags" which are actually functions. They are:
These accept a string as an argument. For example:
__("Translate Me")
_e("Translate Me")
The only functional difference between the two methods is that _e() echoes the string and () simply returns the string. () is used when you want to supply a string to a function. _e() is used when you want to output the string as part of your XHTML.
We have a tool which goes through all of the php files, extracting strings that are marked by __() and _e().
See also:
See also:
See also:
See also: