how to remove default post and comment from wordpress

remove default post and comment from wordpress, When we install the wordpress then wordpress put the dummy post and comment called “hello world”.

how to remove default post and comment from wordpress

If we want to remove that you can easily done this. Using following wordpress plugin.

Delete Default Post

Download the wordpress plugin

This plugin will delete the default post and comments which is inserted by wordpress.

how to remove default post and comment from wordpress
how to remove default post and comment from wordpress

how to create wordpress pages by script

For plugin or custom wordpress theme we need create wordpress pages by script. In this article we given code to how to create wordpress pages by script.

how to create wordpress pages by script

You can create the pages by using script. You can execute any script using the “$wpdb->insert” or

“$wpdb->query”.

For creating wordpress post or page you can use the wp_insert_post function. Before calling wp_insert_post() it is necessary to create an object (typically an array) to pass the necessary elements that make up a post. The wp_insert_post() will fill out a default list of these but the user is required to provide the title and content otherwise the database write will fail.

You can use following code for creating the page.  This code will execute when only you are logged in to wordpress.

// Create post object
  $my_post = array();
  $my_post['post_title'] = 'My post';
  $my_post['post_content'] = 'This is my post.';
  $my_post['post_status'] = 'publish';
  $my_post['post_author'] = 1;
  $my_post['post_type'] = 'page',
  $my_post['post_category'] = array(8,39);

// Insert the post into the database
  wp_insert_post( $my_post );

You can create wordpress plugin and use this code. Use following code for wordpress plugin. Copy the code and create the create_wordpress_pages.php file and put in plugin folder.

/*
Plugin Name: Create WordPress Pages
Plugin URI: http://images.purabtech.in/
Description: Create wordpress pages by script
Version: 1.0
Author: wordpressapi
Author URI: http://images.purabtech.in/
*/
function create_wordpress_pages(){
// Create post object
  $my_post = array();
  $my_post['post_title'] = 'My post';
  $my_post['post_content'] = 'This is my post.';
  $my_post['post_status'] = 'publish';
  $my_post['post_author'] = 1;
  $my_post['post_type'] = 'page',
  $my_post['post_category'] = array(8,39);

// Insert the post into the database
  wp_insert_post( $my_post );
}
register_activation_hook(__FILE__, 'create_wordpress_pages');
how to create wordpress pages by script
how to create wordpress pages by script

How to remove www from URL with nginx server

Nginx web server is becoming most popular in these year. Best server response time and minimum execution time is the advantages of Nginx server. wordpress.com itself using the nginx server for hosting these sites and blogs.

How to remove www from URL with nginx server

How to remove www from URL with nginx server
How to remove www from URL with nginx server

How to remove www from URL with nginx server

Many people want to remove the www from URL. I will tell you the tip how to remove the www from URL with nginx server.

Open your Ngnix configuration file (nginx.conf). Just use following code in server block.

if ($host ~* ^www\.(.*)) {
    set $remove_www $1;
    rewrite ^(.*)$ http://$remove_www$1 permanent;
}

This code will remove the www from the URL.

Here are some useful article about nginx

How to use hosts file on Mac, Windows and Linux
Solved:trailing slash issue with Nginx server

How to remove the www from url with rewite rule

Now these days keeping www in URL is becoming old fashion. How can check many websites for that and the current example is twitter.com. Using apache rule you can remove the www from url with rewite rule.

How to remove the www from url with rewite rule

How to remove the www from url with rewite rule
How to remove the www from url with rewite rule

I specially dont like to put www in URL so we can easily remove the www from URL.

Open your apache configuration file. If you are using Linux then open file from following location

# vim /etc/httpd/conf/httpd.conf

put following lines in your virtual directory section.


# remove www from url
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^.*$ http://example.com%{REQUEST_URI} [R=301,L]

We can use this rewrite rule in .htaccess file also. But make sure .htaccess is enable through apache server.


# remove the www from URL.
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^.*$ http://example.com%{REQUEST_URI} [R=301s,L]

For WordPress websites for seo purpose putting above lines in .htaccess file is really best. That will gives you the really great result in future.

How to create virtual tree effect in photoshop

In this photoshop tutorial we will show you to, create virtual tree effect in photoshop with very simple steps and photo samples.

create virtual tree effect in photoshop

Select first a photo here I selected a tree image

Create duplicate layer of that tree this layer must have to up side of other layers

Now create a layer which is background having black color

Layer status look like below

create virtual tree effect in photoshop
create virtual tree effect in photoshop

Create a new layer in that layer we have to put some shape here I put a leaf shape because the photo is having tree

Now create another layer in that layer we also have to leaf shape but its size has big compare first leaf

Fill the second leaf shape with green color

Now select first duplicate tree layer go to layer >> create clipping mask “ctrl + g”

Your first photo copy is ready now, another is select

Layer >> new >> layer set

In the layer set we have to put this layers

Now make duplicate sets & put in different position on the tree photo

Have fun!

How to create photoshop liquify filter download

Here we now goes to creating liquify effects it’s easy to easy to create photoshop liquify filter download. we given steps to create liquify photoshop filter.

How to create photoshop liquify filter download

If you constant on this effect you can make many more effect on only liquify

We can make effect liquify on text, images…etc

Now we just here look on liquify effect

Select text tool bar

First we select a text here I write a “liquify”

Before select liquify we have to retrize this text

Select layer >> reterize >> type

Select filter >> liquify

How to create photoshop liquify filter download

Now liquify having left side menu bar which you can select any option

Here is given below is liquify tool bar

Create your effect here we selected forward wrap tool

Here is tool option which is you select you can modify that tool as per your need

Here is the effect which I given here

Have fun !!

How to use pagination in wordpress post without plugin

There is difference between post pagination and in post pagination.If you want to keep pagination in wordpress post without plugin, Than use our code

When we are developing the new wordpress theme then we need to always need to think about post pagination and in post pagination. Yes, there is difference between post pagination and in post pagination.

How to use pagination in wordpress post without plugin

How to use pagination in wordpress post without plugin
How to use pagination in wordpress post without plugin

If you want to keep single post and pagination between in single post that is also possible through wordpress api. In this article I will show you hwo to use the in page or post pagination.

Open your single.php file from wordpress theme folder and put following code in that.

<?php wp_link_pages( ); ?>

We can pass the following parameter the this function.

<?php $args = array(
    'before'           => '<p>' . __('Pages:'),
    'after'            => '</p>',
    'link_before'      => ,
    'link_after'       => ,
    'next_or_number'   => 'number',
    'nextpagelink'     => __('Next page'),
    'previouspagelink' => __('Previous page'),
    'pagelink'         => '%',
    'more_file'        => ,
    'echo'             => 1 ); ?>
<?php wp_link_pages( $args ); ?>

This is the one of the sample code.

<?php wp_link_pages('before=</pre>
&after=
<pre>&next_or_number=number&pagelink=page %'); ?>

Now I will explain What wordpress doing for using this function. WordPress is using simple explode php function for using the next page tag. Like following way.

$content = get_the_content();
$pages = explode('<!--<span class="hiddenSpellError" pre="" data-mce-bogus="1">nextpage</span>-->', $content);

you can also use the above code in your loop.

how to create burn effect in photoshop

In this photoshop tutorial, we will show, how to create burn effect in photoshop. Using any image you can add burn effect to image. we given full steps with screen shot and there steps in photoshop.

how to create burn effect in photoshop

First I select one image in PhotoShop

Select another image here I selected one ground image which image 2

In layer panel will look like below

Select layer 2 & give it opacity 62%

Now select first image

go to select >> color range

Cut the part of images

Now the second layer click indicate layer visibility

How to create burn effect on text in photoshop

Here I am going to show you how we can make burn effect on text.

burn effect on text in photoshop

First select text tool writes a text here I am written, “burn”

Second select a fire image & put it on your text

burn effect on text in photoshop
burn effect on text in photoshop

Here I am selected given below fire image

You only have to set the text in center poison of image on front side

We have to set some blending effect on our text

Now select texts go to layer >> blending option >> select drop shadow

Give these values

Now select outer glow

Select inner glow

We also have to add color overlay & stroke

For color overlay select “9C5414” this color value

& For stroke select stroke – 1, color value – FF0000 position inner side

& Opacity is 50%

Now we are going to some burning effects on text

Select filter >> liquefy

Give some small touch effect on text & select smudge tool from tool bar

& Give some cracks on text

So it will look like given below

Now make our text duplicate layer & put on behind to text

Your text burning effect is ready now

How to find mouse position and coordinates

Many times we worked on this topic. In this tutorial we are going to show you, How to find mouse position and coordinates. we given code sample in article.

How to find mouse position and coordinates

[script]
/*
* This get_mouse_coordinates function we are using for capturing the Mouse coordinates of on browser
*/
var isIE = document.all?true:false;
if (!isIE) document.captureEvents(Event.MOUSEMOVE);
document.load = get_mouse_coordinates;
document.onmousemove = get_mouse_coordinates;

function get_mouse_coordinates(e) { // as per Document body

var x_pos;
var y_pos;
if (!isIE) {
x_pos = e.pageX;
y_pos = e.pageY;
}
if (isIE) {
x_pos = event.clientX + document.body.scrollLeft;
y_pos = event.clientY + document.body.scrollTop;
}

alert(x_pos);
alert(y_pos);
}

[/script]

clientX and clientY will work in only Firefox, safari, chrome and opeara. That will not work in IE browsers.

So We need to write condition for IE browsers.
In IE browser use window.event.x and window.event.y methods.

Given example is cross browser tested…

 find mouse position and coordinates
find mouse position and coordinates