This is a general FAQ of Wordpress tips, tricks and advice found throughout this blog. Each question links to the article where you can find more detailed information about its answer. This FAQ will be updated regularly.

How do I automatically display article comments on every page?

Edit your Wordpress template’s index.php file (also called the Main Index Template) by adding <?php $withcomments = 1 ?> just after <?php get_header(); ?> and by adding <?php comments_template(); ?> just before <?php endwhile; else: ?>

The second addition might already be present. If it is, there’s no need to add it.

How do I automatically expand replies to articles  so they display on every page?

See the answer to the question above this

How do I stop the Wordpress TinyMCE editor’s background from using my template’s colour scheme?

Edit your theme’s style.css file (the main css file) and add

body.mceContentBody {
  background-color:#FFFFFF !important;
  background-image: none;
  text-align: left;
}

To its very bottom. Do not put it at the top or in the middle, put it at the bottom to prevent it from being overridden by other styling information.

How do I change the category listing order?

Use the My Category Order plugin.

How do I change the page listing order?

Use the My Page Order plugin.

How do I change the link listing order?

Use the My Link Order plugin.

How do I change the position of the admin login link?

1, use the BNS plugin to move the meta links (dashboard login links) to the footer of your pages,

2, use the Sidebar Login widget plug-in.

How do I add a sitemap to my blog?

Use the Google XML sitemap plugin which will create a sitemap at yourdomain.com/sitemap.xml after you’ve set it up and clicked Build Sitemap,

How do I optimize my blog for search engines?

Use the Greg’s High Performance SEO plugin, SEO Friendly Images plugin and TagPig.

How do I redirect URLs?

Use the Redirection plugin.

How do I automatically tweet my posts?

Use the shorten2ping plugin with either the Twitter setting or Ping.fm setting.

How do I automatically broadcast my posts to social networks?

Use the shorten2ping plugin with the Ping.fm setting.

How do I change the category listing order?

Use the My Category Order plugin

How do I add social networking buttons to my posts?

Use the Sociable plugin.

How do I display a message to visitors based on where they’ve come from?

1, use the WP Greet Box plugin,

2, use the Target Visitors plugin.

How can my users upload their own avatars to my server?

Use the the Avatars plugin.

How do I add a ratings button to my posts?

Some themes provide this as an inbuilt option so check your theme’s settings. Alternatively, use the GD Star Ratings plugin to add either/both ratings stars and/or ratings thumbs.

Can I add a forum to my blog?

Yes you can. Use the Simple:Press plugin to add a completely integrated forum to your blog that resides within your blog’s template. The alternative is to cross-link your blog with a non-integrated forum package such as SMF or phpBB. Simple:Press is the most integrated option in that it’s designed to function with-in Wordpress and not as a standalone product.

Can I write my blog using RSS feeds?

Yes. Use any or all of these three plugins: Feed Wordpress, WP-o-Matics and/or WP Autoblog. WP Autoblog has been discontinued but I do have a copy of it and will provide if you ask nicely.

Can I add more options to the TinyMCE editor?

Affirmative. Use the TinyMCE advanced plug-in to unhide the secret options hidden by the Wordpress  development team. This plug-in also enables you to re-arrange the editor’s buttons’ layout. There’s a button in the TinyMCE editor called the “Kitchen Sink” (it looks like a TV screen with multi-coloured dots scrolled across it): either click it or remove it to display extra buttons.

What’s the best way to add ads to my Wordprss theme?

Use the Ad Buttons plugin to create a sidebar widget into which you may display ads. It’s easier than editing your Wordpress theme. Other options are: javascripts that display text-link ads; and the Linkerator plug-in which allows you to attach links to keywords without editing posts every time you want to change the keywords.

How do I put a copyright notice at the bottom of my blog?

Either edit your theme’s footer (has to be done to every theme you use) else use the Blog Copyright plugin.

Can I automatically translate my blog into different languages?

It can be done using the Global Translator plugin which creates multiple language versions of your website. When using a translator plugin, be careful to write you posts in complete sentences with few to no unambiguous words; keep your grammar and syntax as pure as possible – short sentences might work best for some people; try to not end sentences with a preposition.

How do I display random posts in my side bar?

Use the Random Posts plugin.

Can I add a link directory to my blog?

Yes, there are several link directory plugins available; I like to use the Wordpress Link Directory plugin because the frontend can be customized to look as I want it to look and the backend is intuitive to use. In all honesty, if you want a serious link directory (and not much of a blog) then you can use Joomla! as a pure link directory via a plugin or you can make a few edits to your Wordpress installation’s files to make it into a directory not a blog.

How do I redirect my default RSS feed to my Feedburner RSS feed?

Install the FD Feedburner plugin and add your Feedburner feed’s details to its configuration page.

Is it possible to have post tags automatically written?

Yes, use the TagPig plugin. It scans the text in your posts, compares the words and phrases within it against keyword lists held by tagthe.net, Yahoo and your site’s tag database.

Can I copy the plugins from one blog over to another blog?

In most cases, yes. Some plugins must be installed afresh but, generally, most plugins can be installed by copying yourdomain.com/wordpress/wp-content from your source blog over to yourdomain.com/wordpress/wp-content of your destination blog. Once the copying is complete, visit the destination blog’s Dashboard’s Plugins page and activate the new plugins.

What’s the easiest way to add videos to my blog?

This answer assumes you do not want to use third party hosting when embedding your own video content.

Use Viper’s Video Quicktags to embed content from Youtube, Flickr and Google etc.., and to embed your own videos as uploaded to your Wordpress media gallery or directory to your server.

Is there a user friendly gallery plugin for Wordpress?

Absolutely. The most versatile and user friendly Wordpress gallery (to my thinking) is NextGEN Gallery. It allows you to post thumbnails, full images and slideshows in various layouts. This plugin isn’t limited to javascript, it has a php display option too (don’t worry if you don’t understand that: javascript requires a viewers browser to have javascript enabled where as php only requires the viewer to have a browser capable of displaying graphics).

How do I stop code examples from displaying outside of my template?

You need to edit your template’s style.css file by adding the following code at the top of it:

pre {
white-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */
white-space: -pre-wrap; /* Opera 4 – 6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS3 – Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */
word-wrap: break-word; /* IE 5.5+ */
white-space: -khtml-pre-wrap; /* Safari, not working –  maybe on Konqueror khtml */
color : #000000;
width: 99%;
font-size: 14px;
}

And you need to convert all instances of < to &lt; and > to &gt; and & to &amp; within the example code.

This is the FAQ for the article entitled Huge Text File, Need to Extract Specific Lines? Here’s How. Working examples and more detailed information for each of these commands is available through that link. All these commands work in the Linux terminal, some of them will work in the Windows command line.

How do I  split a large file into small chunks?

split -l [number of lines] [filename]

Remember to remove the parentheses i.e [ and ]

How do I shuffle the data in a text file?

shuf input.txt > output.txt

How do I sort the data in a text file?

sort input.txt > output.txt

How do I delete specific characters or text from a file?

grep "criteria" sourcefile.txt > destinationfile.txt

How do I replace specific characters or text from a file?

sed 's/StringToTeplace/ReplacementString/g' source.txt > destination.txt

Sometimes the forward slashes need to be replaced with # e.g

sed 's#StringToTeplace#ReplacementString#g' source.txt > destination.txt

How do I delete the Nth character within every line of a file?

sed 's/^(.{#}).(.*)/12/' sourcefile > outputfile

Replace # with the character position. The first character you count has the value of 0, zero.

How do I delete the first N characters of every line within a file?

sed  's .{#}  ' source.txt > destination.shtml

Replace # with the number of characters to be removed.

How do I delete the last N characters of every line within a file?

sed 's/.{#}$//g' source.txt > destination.shtml

Replace # with the number of characters to be removed.

How do I delete everything after a specific character in every line within a file?

sed 's/[character].*/[character]/g' source.txt > destination.text

Replace [character] with the demarcation character or characters (do not include the parentheses “[]“)

This can also be used to replace everything after the character with different characters (the second [character] designates the replacements). Leave out the second [character] to delete the [character] too.

How do I delete everything before a specific character in every line within a file?

sed 's/.*
[character]/[character]/g' source.txt > destination.text

Replace [character] with the demarcation character or characters (do not include the parentheses “[]“)

This can also be used to replace everything before the character with different characters (the second [character] designates the replacements). Leave out the second [character] to delete the [character] too.

How do I add characters to the END of every line within a file?

sed 's/$/text to add/g' source.txt > destination.txt

Replace “text to add” with the characters to be added to the end of each data line.

How do I add characters to the BEGINNING of every line within a file?

sed 's/^/text to add/g' source.txt > destination.txt

Replace “text to add” with the characters to be added to the beginning of each data line.

How do I remove duplicate lines of data within a file?

uniq source.txt > destination.txt

The above command checks for repeated data in sequentially so requires the data to be sorted alphanumerically. Alternatively, and better, use the Awk command below which does not require the data to be presorted:

awk '!x[$0]++' source.txt > destination.txt

How do I extract lines within a file that contain specific data?

grep "specific data" source.txt > destination.txt

The quotation marks are essential parts of this command.

Replace specific data with the data the lines to be extracted contain. The quotation marks must be present.

How do I merge n files into one file to separate columns?

paste -d 'delimiter' file1 file2 > newfile

Replace delimiter with the column separation character or code e.g a comma (,) or space ( ) or set of characters (xxxxx)

dp seal trans 16x1616 Text Manipulation FAQ  Copyright secured by Digiprove © 2010