Showing posts with label Wordpress. Show all posts
Showing posts with label Wordpress. Show all posts

Install wordpress on Ubuntu

https://www.digitalocean.com/community/articles/how-to-install-wordpress-on-ubuntu-12-04


About Wordpress


Wordpress is a free and open source website and blogging tool that uses php and MySQL. It was created in 2003 and has since then expanded to manage 22% of all the new websites created and has over 20,000 plugins to customize its functionality.

Setup


The steps in this tutorial require the user to have root privileges. You can see how to set that up in the Initial Server Setup.

Before working with wordpress, you need to have LAMP installed on your virtual private server. If you don't have the Linux, Apache, MySQL, PHP stack on your VPS, you can find the tutorial for setting it up in the Ubuntu LAMP tutorial.

Once you have the user and required software, you can start installing wordpress!

Step One—Download WordPress


We can download Wordpress straight from their website:
wget http://wordpress.org/latest.tar.gz

This command will download the zipped wordpress package straight to your user's home directory. You can unzip it the the next line:
tar -xzvf latest.tar.gz 

Step Two—Create the WordPress Database and User


After we unzip the wordpress files, they will be in a directory called wordpress in the home directory.

Now we need to switch gears for a moment and create a new MySQL directory for wordpress.

Go ahead and log into the MySQL Shell:
mysql -u root -p

Login using your MySQL root password, and then we need to create a wordpress database, a user in that database, and give that user a new password. Keep in mind that all MySQL commands must end with semi-colon.

First, let's make the database (I'm calling mine wordpress for simplicity's sake; feel free to give it whatever name you choose):
CREATE DATABASE wordpress;
Query OK, 1 row affected (0.00 sec)

Then we need to create the new user. You can replace the database, name, and password, with whatever you prefer:
CREATE USER wordpressuser@localhost;
Query OK, 0 rows affected (0.00 sec)

Set the password for your new user:
SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password");
Query OK, 0 rows affected (0.00 sec)

Finish up by granting all privileges to the new user. Without this command, the wordpress installer will not be able to start up:
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

Then refresh MySQL:
FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

Exit out of the MySQL shell:
exit

Step Three—Setup the WordPress Configuration


The first step to is to copy the sample wordpress configuration file, located in the wordpress directory, into a new file which we will edit, creating a new usable wordpress config:
cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php

Then open the wordpress config:
sudo nano ~/wordpress/wp-config.php

Find the section that contains the field below and substitute in the correct name for your database, username, and password:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wordpressuser');

/** MySQL database password */
define('DB_PASSWORD', 'password');
Save and Exit.

Step Four—Copy the Files


We are almost done uploading Wordpress to the virtual private server. The final move that remains is to transfer the unzipped WordPress files to the website's root directory.
sudo cp -r ~/wordpress/* /var/www/

Finally we need to set the permissions on the installation. First, switch in to the web directory:
cd /var/www/

Give ownership of the directory to the apache user.
sudo chown www-data:www-data * -R 
sudo usermod -a -G www-data username

From here, WordPress has its own easy to follow installation form online.

However, the form does require a specific php module to run. If it is not yet installed on your server, download php-gd:
sudo apt-get install php5-gd

Step Five—RESULTS: Access the WordPress Installation


Once that is all done, the wordpress online installation page is up and waiting for you:

Access the page by adding /wp-admin/install.php to your site's domain or IP address (eg. example.com/wp-admin/install.php) and fill out the short online form (it should look like this).

Permalinks are not working with Page Not Found error in wordpress

When this problem occurs, try checking the .htaccess and httpd.config file in apache.

.htaccess format would be

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

wp-config.php would be,



httpd.config format would be,
<directory var/www/>
FollowSymLinks
AllowOverride All
</Directory>

Even after this, if this is not working, then it is the problem of mod_rewrite.
Enable mod_rewrite like running the command in prompt.

a2enmod rewrite
/etc/init.d/apache2 restart
(And then restart the server)

Retrieve all the tags from the wordpress

Displays a list of tags with links to each one and a specific class for each tag:

$tags = get_tags();
$html = '<div class="post_tags">';
foreach ($tags as $tag){
 $tag_link = get_tag_link($tag->term_id);
   
 $html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>";
 $html .= "{$tag->name}</a>";
}
$html .= '</div>';
echo $html;



ref http://codex.wordpress.org/Function_Reference/get_tags

How to have different themes for different pages wordpress

Plugin http://wordpress.org/extend/plugins/headspace2/

Ref http://www.wpqueen.com/wordpress-how-to/how-to-have-different-themes-on-different-pages/

How to change the theme name in wordpress

Change the name of the theme in the style sheet.
Dont confuse though it is commented.

/*
Theme Name: Rose
Theme URI: the-theme's-homepage
Description: a-brief-description
Author: your-name
Author URI: your-URI
Template: use-this-to-define-a-parent-theme--optional
Version: a-number--optional
.
General comments/License Statement if any.
.
*/

How to find the Category ID number in Wordpress ?

Usage

http://www.blogger.com/img/blank.gif

Example

$category_id = get_cat_ID('Category Name');
$q = 'cat=' . $category_id;
query_posts($q);
if (have_posts()) : while (have_posts()) : the_post();

the_content();

endwhile; endif;
?>


Ref

W3 Total Cache

Yup...
Hey hi Dove,
Remeber this call... When we first talked .. i chanted your name.. I been feeling the charm, when calling your name...

was lagging back to write a post.

But as you know, been too busy. Infact, too tired and highly disturbed.
Dove, after all happend... i still feel greatful, knowing you in my life.
thanks a ton for being in ma life.. and taught what is real love.

I feel happy when you are happy. I used to laugh at your naughtiness. Your fingers are responsible for your naughtiness... remember these lines... that amuda song... love it alot... you only transalted the full song for me..

I feel like am fully surrounded by this sorrowful cyclone. Just cant get out of it...
The care you shown.. it is ungogettable..
I still feel the warmness in your hold...

Love you dove.. missing you for the life time.. this feeling itself kills me..
If I had another life... Sure I would give the heavens to share the life with you...

Let me watch you... let me watch you as in bride dress... watch your kids grown up... watch you become old... Watch you in heaven... Be happy always..

I wish i will lead a very happy life with your inspiration with life... Love you Dove .


Oh..  its this W3 total cache which will provide a cache at server side. And this helps a faster page loading. Very good plugin, easy installation and easy settings.

https://www.google.co.in/search?q=w3+total+chache&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a