wordpress get child pages of current page

Using following code you can able to display the subpages of parent page. Tutorial for wordpress get child pages of current page. We have given code sample in this article.

<?php $subpages = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0'); ?>

<?php if ($subpages) { ?>
<ul>
<?php echo $subpages; ?>
</ul>
<?php } ?>

Note: This code you need to copy paste in loop only.

Using following code you can able to display the subpages and subpages of that.

<?php
if($post->post_parent)
$subpages = wp_list_pages(“title_li=&child_of=”.$post->post_parent.”&echo=0″);
else
$subpages = wp_list_pages(“title_li=&child_of=”.$post->ID.”&echo=0″);
if ($subpages) { ?>
<ul>
<?php echo $subpages; ?>
</ul>
<?php } ?>

Using css you modify the UI of menu.

wordpress get child pages of current page
wordpress get child pages of current page

More details you can found on following page
http://codex.wordpress.org/Template_Tags/wp_list_pages

How to use is_page conditional in wordpress

Many people some another content or code need to add in specific pages. WordPress tutorial for, How to use is_page conditional in wordpress.

use is_page conditional in wordpress

How to use is_page conditional in wordpress
How to use is_page conditional in wordpress

In that senorio use should use the is_page condition in page.php file. This file you will find in active wordpress theme folder.

You can use is_page condition in multiple way. Following are the some examples

is_page();
// When any single Page is being displayed.

is_page(42);
// When Page 42 (ID) is being displayed.

is_page(‘Contact’);
// When the Page with a post_title of “Contact” is being displayed.

is_page(‘about-me’);
// When the Page with a post_name (slug) of “about-me” is being displayed.

is_page(array(42,’about-me’,’Contact’));
// Returns true when the Pages displayed is either post ID 42, or post_name “about-me”, or post_title

Note: You can use above condition in only page.php file.

Text wrapping around image in wordpress theme

Many people do not care about what CSS they are putting for p tag and div tag. Text wrapping around image in wordpress theme. So far they are not able to use wordpress default functionality of text wrapping around the image.

Text wrapping around image

wordpress-logo-cristal_thumbnail-300x300
I am suggesting use following CSS in your wordpress theme whenever you are creating the new theme. You can do care about your theme preview but with that keep an eye you are not breaking the default CSS of wordpress.

Use following CSS in your wordpress theme and you will be able to use wordpress text wrapping around the image for your wordpress theme.

/* wordpress’s default CSS */
/* Begin Images */
p img {
padding: 0;
max-width: 100%;
}

/* Using ‘class=”alignright”‘ on an image will (who would’ve
thought?!) align the image to the right. And using ‘class=”centered’,
will of course center the image. This is much better than using
align=”center”, being much more futureproof (and valid) */

img.centered {
display: block;
margin-left: auto;
margin-right: auto;
}

img.alignright {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}

img.alignleft {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}

.alignright {
float: right;
}

.alignleft {
float: left;
}
/* End Images */
/* Captions */
.aligncenter,
div.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}

.wp-caption {
border: 1px solid #ddd;
text-align: center;
background-color: #f3f3f3;
padding-top: 4px;
margin: 10px;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}

.wp-caption img {
margin: 0;
padding: 0;
border: 0 none;
}

.wp-caption p.wp-caption-text {
font-size: 11px;
line-height: 17px;
padding: 0 4px 5px;
margin: 0;
}
/* End captions */

wplogo-notext-rgb

Note: Dot not assign p tag globally to body tag, Use p tag alignment tag as per your custom theme requirement.

Create Horizontal page Menus in WordPress theme

Many people are new in development of wordpress theme. They are searching for how to Create the Horizontal page Menus in WordPress theme. Here is code for creating the Horizontal page Menus in WordPress theme.

Create Horizontal page Menus in WordPress theme

Here I am going to show the simple technique of creating the horizontal page menu with wordpressapi.

Just create pages in wordpress first. Add following lines to your header.php file where you want to show the page menu.


navmenu">
<ul>

<ul>

<ul>
	<li>php echo get_settings('home'); ?>">HOME</li>
</ul>

</ul>

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php wp_page_menu(); ?>
</ul>
</div>

Add folliowing lines in your style.css file.


#navmenu ul {margin: 0; padding: 0; list-style-type: none; list-style-image: none; }
#navmenu li {display: inline; }
#navmenu ul li a {text-decoration:none;  margin: 4px; padding: 5px 20px 5px 20px; color: blue; background: pink;}
#navmenu ul li a:hover {color: purple; background: yellow; }

Horizontal page Menus in WordPress
Create Horizontal page Menus in WordPress theme

 

That sit!

Customize meta description in wordpress theme

wordpress tutorial for, Customize meta description in wordpress theme. In article we will tell you trick to fetch traffic using Meta tags in wordpres theme.

Customize meta description in wordpress theme

Customize meta description in wordpress theme
Customize meta description in wordpress theme

we can do using the META description tag.  We can actually control what gets displayed in our little spot.
gaining the tremendous opportunity to convert that space into traffic with wordpress websites.

Search Engines, like Google, tend to display search results in a very standard format.  Usually the TITLE of the post or page is the link that actually takes you to the post, and under that link is a description of the site linked to.

Normally we write the Meta tags in wordpress theme as follows:


<meta name="description" content="Your site Description goes here" />

Instead of this use following code in your wordpress theme.


<?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<meta name="description" content="<?php the_excerpt_rss(); ?>" />
<?php endwhile; endif; else : ?>
<meta name="description" content="<?php bloginfo('description'); ?>" />
<?php endif; ?>

With adding this lines of code in your header.php file. you will be done.

All time Best WordPress Ebooks

Some years back in start of 2007, When we started working on wordpress that time, we did not so much help or ebooks on wordpress. All time Best WordPress Ebooks. But now we can found pretty much good ebooks and forum help on internet. we found useful ebooks for new blogger and wordpress developer.

List of All time Best WordPress Ebooks

1. WordPress For Dummies, 2nd Edition

All time Best WordPress Ebooks
All time Best WordPress Ebooks

Bloggers love WordPress! If you’re ready to start using this free blogging software, WordPress For Dummies, 2nd Edition is just what you and your blog need to make a splash.

Professional blog designer Lisa Sabin-Wilson shows you how to use all the latest upgrades to WordPress and helps you decide whether to use the WordPress.com hosted service or self-host your blog with WordPress.org. Whether you’re just venturing into the blogosphere or you want to shift an existing blog to WordPress, WordPress For Dummies, 2nd Edition will help.

Explore theme development and learn where to find free WordPress themes Extend WordPress through plug-ins, CSS, custom fields, and more Find out about archiving, interacting with readers through comments, tracking back, and handling spam Get the scoop on domain registration, Web hosting providers, basic tools like FTP, and more Create a unique blog theme and presentation by using template tags with CSS Sign up for WordPress.com, log in, set options, and create a profile Install WordPress.org, set up a MySQL database, explore RSS feeds, and organize a blogroll Discover the secrets of creating a blog that draws readers Get tips on wonderful widgets, upgrades, and plugins you can add to make your blog extra cool Learn how to use the Dashboard, manage comments, and make permalinks work with your Web server With WordPress For Dummies, 2nd Edition on hand, it’s easy to make the most of the free software and build a blog that stands out in a crowd.

2. WordPress: Visual Quickstart Guide

wordpress-visual quick All time Best WordPress Ebooks
wordpress-visual quick All time Best WordPress Ebooks

This book gives readers the tools they need to create beautiful, functional WordPress-powered sites with minimal hassle. Using the WordPress user interface as a baseline, authors Jessica Neuman Beck and Matt Beck walk new users through the installation and setup process while providing valuable tips and tricks for more experienced users. With no other resource but this guide, readers can set up a fully-functional and well-designed WordPress site that takes advantage of all the features WordPress has to offer.

3. Building a WordPress Blog People Want to Read

building a wordpress blog, All time Best WordPress Ebooks
building a wordpress blog, All time Best WordPress Ebooks

Having your own blog isn’t just for the nerdy anymore. Today, it seems everyone—from multinational corporations to a neighbor up the street—has a blog. They all have one, in part, because the folks at WordPress make it easy to get one. but to actually build a good blog—to create a blog people want to read—takes thought, planning, and some effort. From picking a theme and using tags to choosing widgets and building a community, creating your blog really starts after you set it up. In this book by blogger extraordinaire Scott McNulty, you learn how to:

4. WordPress 2

wordpress 2,  All time Best WordPress Ebooks
wordpress 2, All time Best WordPress Ebooks

WordPress is an open-source personal publishing platform that is easy to use, flexible, and highly customizable. Although used primarily for publishing blogs, WordPress can easily be used to create and maintain complete Web sites.

Taking the average blogger further than blogspot can, WordPress allows bloggers to create more complicated sites with their open-source technology, rather than blogger which is limited by HTML changes to their templates.

This easy-to-follow, step-by-step guide shows you how to install, use, and customize WordPress to get the most from the software. Includes tips that explain why certain techniques are better than others, how to watch for potential problems, and where readers can find more information.

5. WordPress theme design

All time Best WordPress Ebooks
All time Best WordPress Ebooks

This book walks through clear, step-by-step instructions to build a custom theme for the WordPress open-source blog engine. The author provides design tips and suggestions and covers setting up your WordPress sandbox, and reviews the best practices from setting up your theme’s template structure, through coding markup, testing, and debugging, to taking it live. The last three chapters cover additional tips, tricks, and various cookbook recipes for adding popular site enhancements to your WordPress theme designs using 3rd-party plugins as well as creating API hooks to add your own custom plugins. Whether you’re working with a pre-existing theme or creating a new one from the ground up, WordPress Theme Design will give you the know-how to effectively understand how themes work within the WordPress blog system enabling you to have full control over your site’s design and branding.  more >>

6. WordPress 100 Success Secrets: Start Your Blog Today: WordPress Complete

WordPress is a free blogging platform available to everyone. WordPress has two components, one is a free, Web-based blog-hosting service called WordPress.com. The other is WordPress.org, which provides users with software to run a more feature-rich version of the blogging tool on their own servers.

Both services offer a very easy way to blog, with administrative options to work collaboratively on one or several blogs using the same log-in. Bloggers can write their posts on a WYSIWYG editor, or switch over to a code view on the fly.

This is a great introduction to WordPress. As simple as WordPress is to administer, you will still need hand holding. Before this there has not been a book on WordPress that got you on your way.

This book assumes no blogging or technical background and does a good job of explaining the basics.

For the non-technical the hosted version of WordPress is a great place to begin. For those needing more there are the install-it-yourself versions. You will find everything you need in regards to hosting companies that offer 1 click installs of the regular version WordPress.

Once you’re set up, you’ll be so educated about WordPress that you’ll not only be blogging on the most democratic platform but also involved with one of the most friendly, intelligent and devoted open source communities in the world. Soon you’ll be customizing your blog to the bliss you’ll be following for the rest of your life.

Not sure where to start blogging? Stuck fiddling around with your blog’s limitations? Interested in improving the world through a remarkable blogging platform? Then do yourself a big favor and invest in this book.

Highly recommended to anybody who needs to run a blog or to budding web designers who would like to extend their toolkit.

nginx wordpress plugins nginx setup for wordpress

Nginx is becoming very popular to host the websites. WordPress is best and popular CMS in the world now. Nginx gives really great performance with wordpress sites. Earlier I given the Nginx configuration with this code. I given code for wordpress and Nginx configuration. For hosting your wordpress website on Nginx server is the best option.

nginx wordpress plugins nginx setup for wordpress

If you have dedicated server then go with nginx server.

wordpress + Nginx + permalink

nginx wordpress plugins nginx setup for wordpress
nginx wordpress plugins nginx setup for wordpress

I found two plugins which are supported to Nginx installtion. But both plugins are not give you nginx rule for setup nginx rule.

http://wordpress.org/extend/plugins/nginx-compatibility/
http://wordpress.org/extend/plugins/nginx-proxy-cache-integrator/

Now I will show you how setup wordpress site on Nginx server.

Just put following code in your nginx.conf file. This code will fix the wordpress permalink issue also.

server {
listen 80;
server_name localhost.localdomain;
# access_log logs/site.access.log;

location / {
root /usr/share/nginx/html;
index index.php;

if (!-e $request_filename) {
rewrite ^.+?(/wp-.*) /$1 last;
rewrite ^.+?(/.*\.php)$ /$1 last;
rewrite ^(.+)$ /index.php?q=$1 last;
break;
}

location = /50x.html {
fastcgi_pass  localhost:9999;
fastcgi_index index.php;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SCRIPT_FILENAME  /var/www/example.com$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
root /var/www/nginx-default;
}

}

Note: Dont forgot to install fastcgi on your server. Start the fastcgi server on port no 9000(which is default port)

For wordpressMu use following URL

https://purabtech.in/nginx-rule-for-wordpressmu-with-pretty-url/

Issue with query_posts and pagination

If you are using query_posts in your theme for category and you are facing issue with pagination. usage of query_posts, leave the original query on the home page intact, and modify the query from your functions.php file, using pre_get_posts

Solved issue with query_posts and pagination

we solved Issue with query_posts and pagination. If you are using query_posts in your theme and you are facing issue with pagination. for altering any query

Use following code to fix the issue with pagination.

php
$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
$sticky=get_option(‘sticky_posts’);
$args=array(
‘cat’=>3,
‘caller_get_posts’=>1,
‘post__not_in’ => $sticky,
‘paged’=>$paged,
);
query_posts($args);
?>

or use following code.

php if (have_posts()) : ?>
php query_posts(“cat=3”); ?>
php while (have_posts()) : the_post(); ?>

replace with above with this code.

php if (have_posts()) : ?>
php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts(“cat=3&paged=$paged”); ?>
<?php while (have_posts()) : the_post(); ?>

Solved issue with query_posts and pagination
Solved issue with query_posts and pagination

Useful article for query post

http://codex.wordpress.org/Template_Tags/query_posts

set max image size in wordpress post for showing

wordpress tutorial, Here in this article, How to  set max image size in wordpress post for showing. We given simple CSS code which can be used in your style.css file.

Simply paste the following in your style.css file. This code will work with latest wordpress versions.

 set max image size in wordpress post for showing

.postarea img {
max-width: 500px;
height: auto;
}

.post img {
max-width: 500px; /* Adjust this value according to your content area size*/
height: auto;
}

.size-full {
max-width: 500px;
height: auto;
}

 set max image size in wordpress post for showing
set max image size in wordpress post for showing

How to show Twitter Followers Count on wordpress widget

We all are having the twitter account. If we want to show Twitter Followers Count on wordpress widget then just use our code.

How to show Twitter Followers Count on wordpress widget

Open your sidebar.php file and just copy paste the following code.

First you would need to create a file twitter.php and paste the following code in there:


<?php

//This xml file will return the all user information about from twitter account
$xml=file_get_contents('http://twitter.com/users/show.xml?screen_name=wordpressapi');
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) {
$twitter_follower_count['count'] = $match[1];

// this will show the twitter followers count
echo $twitter_follower_count['count'];
?>

WordPressapi is my twitter username. So you can change it your username.