Showing posts with label wordpress. Show all posts
Showing posts with label wordpress. Show all posts

LearnPress Plugin How to Add Currency ThimPress in Wordpress

LearnPress Plugin How to Add New Currency ThimPress in Wordpress

Hi Today I discussed LearnPress Plugin How to Add New Currency ThimPress in Wordpress. Wordpress woo-commerce LearnPress Plugin Add New Currency and Symbol Here Code.

LearnPress Plugin How to Add Currency ThimPress in Wordpress
LearnPress Plugin How to Add Currency ThimPress in Wordpress
Theme functions.php file Edit Paste this Code

Add currecies edit your own currency and then save and check it.

add_filter( 'learn_press_get_payment_currencies', 'add_my_currency' );

function add_my_currency( $currencies ) {

     $currencies['PKR'] = 'Pakistan';

     return $currencies;


add_filter('learn_press_currency_symbol', 'add_my_currency_symbol', 10, 2);

function add_my_currency_symbol( $currency_symbol, $currency ) {

     switch( $currency ) {

         case 'PKR': $currency_symbol = 'Rs.'; break;


     return $currency_symbol;


WordPress Post Insert Using Ajax Page Without Refresh

WordPress Post Insert Using Ajax Page Without Refresh

Hi, Today Discussed WordPress Post Insert Using Ajax Page Without Refresh WordPress more then plugin used and then today we discussed blog posting contact form what ever posting insert database ajax without refresh stored db.

WordPress Complete content form-process.php wordpress all file is path wp-content/theme/_____
that the find functions for function.php or other file function wp_insert_post() is not defined, because the WordPress core was not loaded.

WordPress Post Insert Using Ajax Page Without Refresh
WordPress Post Insert Using Ajax Page Without Refresh

add_action( 'admin_ajax_your_form_action', 'wpse_126886_ajax_handler' );

function wpse_126886_ajax_handler() {

    // maybe check some permissions here, depending on your app
    if ( ! current_user_can( 'edit_posts' ) )

    $post_data = array();
    //handle your form data here by accessing $_POST

    $new_post_ID = wp_insert_post( $post_data );

    // send some information back to the javascipt handler
    $response = array(
        'status' => '200',
        'message' => 'OK',
        'new_post_ID' => $new_post_ID

    // normally, the script expects a json respone
    header( 'Content-Type: application/json; charset=utf-8' );
    echo json_encode( $response );

    exit; // important
your_form_action slug is the >> trigger of your Call Back. you have to append this slug to your request parameter named form input name normally get or post method using jquery ajax  passing data parameter or form data using .serialize(). Input type hidden field passing parameter.

<input type="hidden" name="action" value="your_form_slug" />

and then file path wp-admin/admin-ajax.php

    type: "POST",
    url: "",
    data: dataString,
    error: function(jqXHR, textStatus, errorThrown){                                        
        console.error("The following error occured: " + textStatus, errorThrown);                                                       
    success: function(data) {                                       
        console.log("Hooray, it worked!");                                                                  

Wordpress Dropdown Category Ajax Search

WordPress Drop down Category Ajax Search

Today Discussed wordpress dropdown category list ajax search without plugin and create shortcodes follows briefly discussed. normally any search field or any one task mostly used plugin activate list of more then plugin this the wordpress large file and buy the plugin. So just avoid plugin hardcode this wordpress is category list ajax search follows code.

Wordpress Dropdown Category Ajax Search
Wordpress Dropdown Category Ajax Search


function ajax_filter_search($atts, $content = null) {
  'post_type'    => AFSAdmin::afs_retrieve('_general_post_type'),
  'post_tax'     => AFSAdmin::afs_retrieve('_general_post_taxonomy'),
  'posts_per_page'  => AFSAdmin::afs_retrieve('_general_posts_per_page'),
  'filter_type'   => '',
  'filter_by'     => '',
  'filter_months'    => '',
  'filter_years'    => '',
  'filter_withPDF'   => '',
  'offset'     => 0,
    ), $atts));

ajax filter search what ever search stored array format year month and pdf taxnonmy etc.,  and included functions and follows code.

if($post_type == '') { } else { $afs_args .=' post_type="'.$post_type.'" '; }
 if($posts_per_page == '') { } else { $afs_args .=' posts_per_page="'.$posts_per_page.'" '; }
 if($filter_by == '') { } else { $afs_args .=' filter_by="'.$filter_by.'" '; }
 if($filter_months == '') { } else { $afs_args .=' filter_months="'.$filter_months.'" '; }
 if($filter_years == '') { } else { $afs_args .=' filter_years="'.$filter_years.'" '; }
 if($filter_withPDF == '') { } else { $afs_args .=' filter_withPDF="'.$filter_withPDF.'" '; }
 if($offset == '') { } else { $afs_args .=' offset="'.$offset.'" '; }
 if($filter_type == '') { 
  $filter_type_count = 999;
 } else { 
  $afs_args .=' filter_type="'.$filter_type.'" '; 
  $filter_type_array = explode(',',$filter_type);
  $filter_type_count = count($filter_type_array);
 $text = '';
 $i = 1;
ajax filter conditions check else and true or false conditions check and then show this html code included same php format follows.

$text .= '<div id="afs-wrapper">';
 $text .= ' <div class="press-releases">';
 $text .= '  <form id="newsForm">';
 $text .= '   <div class="row">';
 $text .= '    <div class="col-xs-1TableRowItem2">';
   $text .= '       <label for="category"><strong>Display:&nbsp;</strong></label>';
   $text .= '       <select name="category">';
   $text .= '        <option value="all">All</option>';
             $terms = get_terms($taxonomy, $args = array('orderby'=>'id') );
             if($terms) {
              foreach($terms as $term) {
               if(isset($filter_type_array)) {
                if(in_array($term->slug,$filter_type_array)) {
                 if($term->name == 'Uncategorized') { continue; }
                 $text .= '<option value="'.$term->slug.'">'.$term->name.'</option>';
               } else {
                if($term->name == 'Uncategorized') { continue; }
                 $text .= '<option value="'.$term->slug.'">'.$term->name.'</option>';
   $text .= '       </select>';
   $text .= '      </div>';
   $text .= '     </div>';

if (!function_exists('myplugin_ajaxurl')) {
 add_action('wp_head', 'myplugin_ajaxurl');
 function myplugin_ajaxurl() {
    echo '<script type="text/javascript">
      var ajaxurl = "' . admin_url('admin-ajax.php') . '";
      var scriptpath = "' . site_url() . '";

if (!function_exists('my_action_callback')) {
 // Ajax call to sort PRs
 function my_action_callback() {  
  // Get the values:
  $post_type  = AFSAdmin::afs_retrieve('_general_post_type');
  $posts_per_page = AFSAdmin::afs_retrieve('_general_posts_per_page');
  $filter_type  = $_POST['filingType'];
  $filter_by   = $_POST['filterBy'];
  $filter_months  = $_POST['filterMonths'];
  $filter_years  = $_POST['filterYears'];
  $filter_withPDF = $_POST['withPDF'];
  $offset    = $_POST['page'];
  echo do_shortcode('[afs_feed post_type="'.$post_type.'" posts_per_page="'.$posts_per_page.'" offset="'.$offset.'" filter_type="'.$filter_type.'" filter_by="'.$filter_by.'" filter_months="'.$filter_months.'" filter_years="'.$filter_years.'" filter_withPDF="'.$filter_withPDF.'"]');
 add_action('wp_ajax_my_action', 'my_action_callback');
 add_action('wp_ajax_nopriv_my_action', 'my_action_callback');

if (!function_exists('get_selected_taxonomy')) {
 // Ajax call to get taxnomy values
 function get_selected_taxonomy() {  
  // Get the values:
  $cur_post_tax = AFSAdmin::afs_retrieve('_general_post_taxonomy');
  $post_type   = $_POST['option'];
  $taxonomy_objects = get_object_taxonomies($post_type, 'objects');
  if($taxonomy_objects) {
   foreach($taxonomy_objects as $tax) {
    $sel = '';
    if($tax->name == 'post_format') {
    } else {
     if($tax->name == $cur_post_tax) { $sel = 'selected="selected"'; }
     echo '<option value="'.$tax->name.'" '.$sel.'>'.$tax->label.'</option>';
  } else {
   echo '<option value="none" '.$sel.'>None</option>';
 add_action('wp_ajax_get_selected', 'get_selected_taxonomy');
 add_action('wp_ajax_nopriv_get_selected', 'get_selected_taxonomy');

/*add_action( 'admin_footer', 'my_action_javascript' ); // Write our JS below here

function my_action_javascript() { ?>
 <script type="text/javascript" >
 jQuery(document).ready(function($) {
  $('#afs-form input#submit').on({
   click: function(){
    //return false;
  var data = {
   'action': 'my_action',
   'whatever': 1234

  // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php, data, function(response) {
   console.log('Got this from the server: ' + response);
 </script> <?php

How to related Post show in wordpress

How to related Post show in wordpress

How to related Post show in wordpress
How to related Post show in wordpress

How to related post show in wordpress is today discussed. Blog posting and any other post related post showing index page or any other page showing wordpress themes folder wp-contents and new folder create includes and showing code follows.


$tags = wp_get_post_tags($post->ID);
if ($tags) {
$tag_ids = array();

foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
'tag__in' => $tag_ids,
'post__not_in' => array($post->ID),
'showposts' => 4, // these are the number of related posts we want to display
'ignore_sticky_posts' => 1 // to exclude the sticky post
// WP_Query takes the same arguments as query_posts
$related_query = new WP_Query($args);
if ($related_query->have_posts()) {

<?php $blog_related = of_get_option('blog_related'); ?>
<?php if($blog_related){?>
<h3><?php echo of_get_option('blog_related'); ?></h3>
<?php } else { ?>
<h3><?php _e('Related Posts','drivingSchool');?></h3>
<?php } ?>
<ul class="related-posts">
while ($related_query->have_posts()) : $related_query->the_post();
<?php if(has_post_thumbnail()) { ?>
$thumb = get_post_thumbnail_id();
$img_url = wp_get_attachment_url( $thumb,'full'); //get img URL
$image = aq_resize( $img_url, 140, 100, true ); //resize & crop img
<figure class="featured-thumbnail">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo $image ?>" alt="<?php the_title(); ?>" /></a>
<?php } ?>

<h6 class="relatedPost"><a href="<?php the_permalink() ?>" > <?php the_title();?> </a></h6>
<?php }

Which page showing related  post just copy and past this code. and more wordpress functions click here

<?php get_template_part( 'includes/post-formats/related-posts' ); ?>
<?php comments_template('', true); ?>

Categorized list of WordPress functions

Categorized list of WordPress functions that are commonly used when building, updating and maintaining templates.

Wordpress Basics Temlate Files and updates customized data and categorized listed and funcation loop functions and basics function and default functions follows.

Categorized list of WordPress functions
Categorized list of WordPress functions

Basic Template Files

File Name Description
style.css style sheet file
index.php   ome page file
header.php header content file
single.php single post page file
archive.php archive/category file
searchform.php search form file
search.php search content file
404.php error page file
comments.php  comments template file
footer.php footer content file
sidebar.php sidebar content file
page.php single page file
front-page.php latest posts or static page
tag.php display tags in archive format
category.php display categories in archive format

Header Functions

Function Description

<?php site_url(); ?>   root url for website

<?php wp_title(); ?> title of specific  post/page

<?php bloginfo('name'); ?> title of site

<?php bloginfo('description'); ?> site description

<?php get_stylesheet_directory(); ?> stylesheet folder location

<?php bloginfo('stylesheet_url'); ?> style.css file location

<?php bloginfo('pingback_url'); ?>  pingback url

<?php bloginfo('template_url'); ?> template folder path

<?php bloginfo('version'); ?> wordpress blog version

<?php bloginfo('atom_url'); ?> atom url

<?php bloginfo('rss2_url'); ?>  rss2 url

<?php bloginfo('url'); ?> root url for website

<?php bloginfo('html_type'); ?> html version

<?php bloginfo('charset'); ?> charset parameter

Navigation Menu

Default Navigation Menu

<?php wp_nav_menu(); ?>

Specific Navigation Menu

<?php wp_nav_menu( array('menu' => 'Project Nav' )); ?>

Category Based Navigation

<ul id="menu">

<li <?php if(is_home()) { ?> class="current-cat" <?php } ?>>

<a href="<?php bloginfo('home'); ?>">Home</a></li>

<?php wp_list_categories('title_li=&orderby=id');?>


Page Based Navigation

<ul id="menu">

<li <?php if(is_home()) { ?> class="current-page-item" <?php } ?>>

<a href="<?php bloginfo('home'); ?>">Home</a></li>

<?php wp_list_pages('sort_column=menu_order&depth=1&title_li=');?>


The Loop

Basic Loop

<?php if(have_posts()) { ?>

<?php while(have_posts()) { ?>

<?php the_post(); ?>

<?php // custom post content code for title, excerpt and featured image ?>

<?php } // end while ?>

<?php } // end if ?>

Template Functions

Function Description

<?php the_content(); ?> content of posts/pages

<?php if(have_posts()): ?> check if there are posts

<?php while(have_posts()): the_post(); ?> shows posts

<?php endwhile; ?> closes loop

<?php endif; ?> closes if

<?php get_header(); ?> header.php file contents

<?php get_sidebar(); ?> sidebar.php file contents

<?php get_footer(); ?> footer.php file contents

<?php the_time('m-d-y'); ?> the date is '08-18-07'

<?php comments_popup_link(); ?> link to comments of post

<?php the_title(); ?> title of post/page

<?php the_permalink(); ?> url of post/page

<?php the_category(); ?> category of post/page

<?php the_author(); ?> author of post/page

<?php the_ID(); ?> id of post/page

<?php edit_post_link(); ?> edit link of post/page

<?php wp_list_bookmarks(); ?> links from blogroll

<?php comments_template(); ?> comment.php file contents

<?php wp_list_pages(); ?> list all pages

<?php wp_list_categories(); ?> list all categories

<?php next_post_link('%link'); ?> url to next post

<?php previous_post_list('%link'); ?> url to previous post

<?php get_calendar(); ?> show post calendar

<?php wp_get_archives(); ?> list of archive urls

<?php posts_nav_link(); ?> next and previous post link

<?php rewind_posts(); ?> rewinds post for a second loop

Extra Functions

Function Description

/%postname%/ custom permalinks

<?php include(TEMPLATEPATH . '/x'); ?> include file from template folder

<?php the_search_query(); ?> value returned from search from

<?php _e('Message'); ?> return translated text from translate()

<?php wp_register(); ?> register link

<?php wp_loginout(); ?> login/logout link

<!--nextpage--> divide content into pages

<!--more--> cut off content and create link to full

<?php wp_meta(); ?> admin meta data

<?php timer_start(); ?> start page timer (header.php)

<?php timer_stop(1); ?> time to load the page (footer.php)

<?php echo get_num_queries(); ?> show queries executed to generate

Wordpress Meta Description Not Showing in Frontend

Wordpress Meta Description Not Showing in Frontend

Today Discussed wordpress meta description Not showing seo yoast plugin problem. How to handle this task. First one seo yoast set up this plugin.

Wordpress Meta Description Not Showing in Frontend
Wordpress Meta Description Not Showing in Frontend

Seo Yoast Plugin sometime not working in meta description is not showing in frontend this problem seo issue is empty meta description. This case handle is very simple. following code copy and paste header.php

<meta name="description" content="<?php
 // if home page output blog name and description
 if (is_home()) { bloginfo('name'); echo " - "; bloginfo('description');}
 // if single page output either excerpt if available or post title
 elseif (is_single()) {
 $custommeta = get_post_meta($post->ID, "MetaDescription", true);
 // checks ot see if the custom field MetaDescription is not empty
 if ($custommeta !=='') {echo $custommeta;}
 // check if excerpt exists for the post and output it if it does
 elseif (!empty($post->post_excerpt)) {the_excerpt();}
 // if there's no custom field or excerpt output the post title
 else {single_post_title('', true);}
 // if category page output the category description
 elseif (is_category()) {echo category_description();}

 // if it's any other page display this generic description
 else { echo 'Add your own generic site description here';}
after check it your site view source now showing meta description. more details please visite

Using AJAX With PHP on Your WordPress Site Without a Plugin

Using AJAX With PHP on Your WordPress Site Without a Plugin

Today Discussed Using Ajax with php on your wordpress site without a plugin. It enables websites to load content into various elements without refreshing the page. This may not seem like a huge feature list but it allows us to do so much.

Using AJAX With PHP on Your WordPress Site Without a Plugin
Using AJAX With PHP on Your WordPress Site Without a Plugin

How AJAX Works

  • You specify information to send
  • You configure the Ajax call
  • The XMLHttpRequest object is used to send the data to the server
  • The server response is returned and can be used by your JS code
  • Ajax is most commonly used through jQuery wrapper functions. If you would like to learn Ajax without jQuery I suggest taking a look at the W3Schools Tutorial. Here we’ll be looking at the jQuery functions only.

add_action( 'wp_enqueue_scripts', 'ajax_test_enqueue_scripts' );
function ajax_test_enqueue_scripts() {
wp_enqueue_script( 'test', plugins_url( '/test.js', __FILE__ ), array('jquery'), '1.0', true );

Creating the Ajax Call

jQuery(document).ready( function($) {

url: "",
success: function( data ) {
alert( 'Your home page has ' + $(data).find('div').length + ' div elements.');


Storing And Displaying Our Data

We’ll be storing the number of “loves” a post has received in a meta field in the database, let’s call it post_love. The value of this field will be displayed under each post in the single page, here’s how:

add_filter( 'the_content', 'post_love_display', 99 );
function post_love_display( $content ) {
$love_text = '';

if ( is_single() ) {

$love = get_post_meta( get_the_ID(), 'post_love', true );
$love = ( empty( $love ) ) ? 0 : $love;

$love_text = '<p class="love-received"><a class="love-button" href="#" data-id="' . get_the_ID() . '">give love</a><span id="love-count">' . $love . '</span></p>';


return $content . $love_text;


How to Fix Duplicate Title Tags and Meta Description on WordPress

How to Fix Duplicate Title Tags and Meta Description on WordPress

Wordpress Duplicate title tags and meta description issue Fixed  without plugins.  Search Engin Optimization (SEO) in the process of writting the page is the most important aspect, which directly affects the relevance of the theme of the page and the user hits.  A good title is not only able to get ranksed in the search engines and traffic, but also to attract more users to click to come in to browse.

How to Fix Duplicate Title Tags and Meta Description on WordPress
How to Fix Duplicate Title Tags and Meta Description on WordPress

Blog post pagination add title duplicate title issue seo problems so this issue pagination current page add in meta title.

<title>page title - pagination number</title>

Duplicate  metatitle and metadescription code follows copy and paste theme functions.php
/** Add Page Number to Meta Description to avoid Duplication **/
if ( ! function_exists( 't5_add_page_number' ) )
    function t5_add_page_number( $s )
        global $page;
        $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
        !empty ( $page ) && 1 < $page && $paged = $page;
         $paged > 1 && $s .= ' - ' . sprintf( __( 'Page %s' ), $paged );
         return $s;
    add_filter( 'wpseo_title', 't5_add_page_number', 100, 1 );
    add_filter( 'wpseo_metadesc', 't5_add_page_number', 100, 1 );

Convert Your WordPress theme to HTML 5

Convert Your WordPress Theme to HTML 5

Convert Your WordPress (Theme to HTML 5) Site customized your theme and your choose modify convert this theme html version today discussed this task. HTML 5 is a great set of new features and easy options.  Soon it will have the full support of most browsers in use today.  Eventually everyone will have to convert WordPress themes from XHTML to HTML5. wordpress Random display post
Convert Your WordPress theme to HTML 5


  • header.php
  • index.php
  • sidebar.php:
  • footer.php
  • single.php (Optional)

Basic HTML5 Layout

<!DOCTYPE html>
<html lang="en">
    <title>TITLE | Dev2tricks!</title>
    <nav role="navigation"></nav>
<!--Ending header.php-->
<!--Begin  index.php-->
    <section id="content">
        <article role="main">
            <h1>Title of the Article</h1>
            <time datetime="YYYY-MM-DD"></time>
            <p>Some lorem ispum text of your post goes here.</p>
            <p>The article's text ends.</p>
        <aside role="sidebar">
            <h2>Some Widget in The Sidebar</h2>
<!--Ending index.php-->
<!--begin  footer.php-->
    <footer role="foottext">
        <small>Some Copyright info</small>

Step 1 Converting header.php to HTML5

Now I will show you the code commonly used in the header.php of XHTML WordPress themes.

XHTML Theme header.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<title>My  Blog</title>
<?php wp_head(); ?>
<!-- Header  -->
<div class="header">
    <div class="container">
        <h1><a href="<?php bloginfo('url');?>">My Blog is Working Great.</a></h1>
    </div><!-- End  Container -->
</div><!-- End  Header -->
<!-- Navigation Bar Starts -->
<div class="navbar">
    <div class="container">
        <ul class="grid nav_bar">
            <?php wp_list_categories('navs_li='); ?>
<!-- Navigation Bar Ends -->
<div class="container">

HTML5 header.php (Conversion)

Read the code and then follow the instructions below to convert your theme's header.php to HTML5.

<!doctype html>
<title>My Blog</title>
<?php wp_head(); ?>
<!-- Header -->
    <div class="container">
        <h1 class="grid"><a href="<?php bloginfo('url');?>">My Blog is Working Great.</a></h1>
<!-- End Header  -->
<!-- Navigation Bar Starts-->
    <div class="navbar">
        <ul class="grid nav_bar">
            <?php wp_list_categories('title_li='); ?>
<!-- Navigation Bar Ends -->
<section class="container">

Step 2 Converting index.php to HTML5

Converting first home page or index.php a common XHTML index.php consists of the following tags.  i will convert each of them follow us I will explain the whole process after conversion.

XHTML index.php

<div id="container">
<div id="content">
<div id="entries">
<div id="post">...</div>
</div><!--Ending Entries-->
<?php get_sidebar(); ?>
</div><!--Ending content-->
</div><!--Ending container-->
<?php get_footer(); ?>

HTML5 index.php (Conversion)

<div id="container">
    <div id="content">
        <section id="entries">
            <article id="post">...</article>
        </section><!--end entries-->
        <?php get_sidebar(); ?>
    </div><!--end content-->
</div><!--end wrap-->
<?php get_footer(); ?>

Complete Index.php in HTML5

<section class="entries">
  <?php if (have_posts()) : while (have_posts()) : the_post();
<article class="post" id="post-<?php the_ID(); ?>">
    <aside class="post_image">
        if ( has_post_thumbnail() ) { 
        } else { ?>
            <a href="<?php the_permalink() ?>"><img src="<?php bloginfo('template_directory');?>/images/noImage.gif" title="<?php the_title(); ?>" /></a>
        <?php }?>
    <section class="post_content">
        <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
        <p><?php echo get_the_excerpt(); ?></p>
        <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>" class="read_more ">Read More</a>
    <section class="meta">
    <p> <?php the_category(',') ?></p>
    <p><?php the_tags(""); ?></p>
  <?php endwhile; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
  <?php endif; ?>
  <?php posts_nav_link(' ⏼ ', __('« Newer Posts'), __('Older Posts »')); ?>

Top 5 Most Popular WordPress Plugin

Top 5 Most Popular WordPress Plugin

Most Popular Plugin The following contains a list of the top 5 most popular WordPress Plugins that have been detected by WordPress Theme.

1. Yoast WordPress SEO Plugin

Yoast WordPress SEO
Yoast WordPress SEO

Easily optimize your WordPress site with one plugin and Real time content analysis functionality and many more features to streamline your site.a Premium Yoast seo plugin for even same but more features and support seo. Read More

2.Contact Form 7
Contact Form7
Contact Form7

Contact Form 7 can manage multiple contact forms, plus you can customize the form and the mail contents flexibly with simple markup. The form supports Ajax-powered submitting, CAPTCHA, Akismet spam filtering and so on.  Read More

3.All In One SEO Pack

All In One SEO
All In One SEO
The most downloaded plugin for WordPress (almost 30 million downloads). Use All in One SEO Pack to automatically optimize your site for Search Engines Read More

4. Js_composer


Visual Composer is the #1 best selling frontend and beackend drag and drop page builder Read More



Wordpress Woocommerce site Your page selling product and more selling website very easily product added and cart page check out in your site.  Read More

Wordpress Include Functions

Wordpress Functions

First Header Include header.php template files from your current theme's directory.  If a name is specified then a specialised header- name.php  will be included.
Wordpress Functions
Wordpress Functions

Header Functions

<?php get_header( $name );  ?>

Single Header

<?php get_header(); ?>
<h2>Error 404 - Not Found</h2>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Multiple Header

if ( is_home() ) :
get_header( 'home' );
elseif ( is_404() ) :
get_header( '404' );
else :


get_sidebar ( string $name = null )

Load sidebar template.

Includes the sidebar template for a your theme or if a name specified then a specialised sidebar will be included. For the parameter, if the file is called “sidebar-special.php” then specify “special”.

<?php get_sidebar('my-bar'); ?>

Sidebar Left and Right

<?php get_header(); ?>
<?php get_sidebar( 'left' ); ?>
<?php get_sidebar( 'right' ); ?>
<?php get_footer(); ?>

Comments_template Functions

comments_template ( string $file = '/comments.php', bool $separate_comments = false )

function comments_template( $file = '/comments.php', $separate_comments = false ) {
    global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;

    if ( !(is_single() || is_page() || $withcomments) || empty($post) )

    if ( empty($file) )
        $file = '/comments.php';

    $req = get_option('require_name_email');

<?php comments_template( '/short-comments.php' ); ?>

<?php comments_template( '/custom-templates/alternative-comments.php' ); ?> 

Wordpress Shopping cart Installation

How to Use WP Shopping Cart

Wordpress Shopping cart
Wordpress Shopping cart

Add the shopping cart to your theme.

Copy wp-shopping-cart.php to your theme directory. Call the shopping cart in your functions.php file: Normal PHP shopping car


Configure your settings.

In the wp-shopping-cart.php file, replace these variables with your information:
$paypal_account - Your PayPal email address
$cart_icon - An icon for your shopping cart link, if you have one
$url_store - The URL of your store
$url_cart - The URL of your shopping cart
$url_update - The meta info/URL when the cart is updated
$url_success - The meta info/URL when the checkout is successful
Shipping variables - Based on shopping cart subtotal value

 Create product pages.

Create pages for your products, and use the [add_to_cart] shortcode to create links.

Shortcode variables:
product="PRODUCT NAME"
options="TITLE=OPTION 1|OPTION 2|OPTION 3" (Not required. Limit 1 set of options.)

[add_to_cart product="T-Shirt" price="20" options="Size=Small|Med|Large"]

Create a shopping cart page.

Create a shopping cart page, and use the [checkout_cart] shortcode to embed a cart.

 Add a link to the cart.

Add a link to the cart anywhere on your site using the [checkout_cart_link] shortcode or <?php echo checkout_cart_link(); ?>.

Another Method

WP Shopping Cart Installation

  • Unzip and Upload the folder “wordpress-paypal-shopping-cart” to the “/wp-content/plugins/” directory.
  • Activate this Plugin
  • Go to settings and configure the options your peyment method paypal email,shopping cart and return url etc
  • Use the shortcode to add a product a post or page where you want it to appear

WP Shopping Cart

To add the ‘Add to Cart’ button simply insert the following shortcode to a post or page next to the product description:

[wp_cart_button name="PRODUCT-NAME" price="PRODUCT-PRICE"]

Replace PRODUCT-NAME and PRODUCT-PRICE with the actual name and price.

Here is an example usage of the shortcode:

[wp_cart_button name="Test Product" price="19.95"]
To add the shopping cart to a post or page, insert the following shortcode to a post or page.

Using Button and Cart Form a template File

To Add 'Add Cart Button' from template.php file use this code:
<?php echo print_wp_cart_button_for_product('PRODUCT-NAME', PRODUCT-PRICE); ?>
<?php echo print_wp_cart_button_for_product('wordpress', 7.50); ?>
To add the shopping cart to the sidebar, simply use the widget from the widgets menu or add the following line to your sidebar template file where you want the shopping cart to appear

<?php echo print_wp_shopping_cart() ?>

WordPress Creating a Static Front Page

WordPress Creating a Static Front Page

         Wordpress shows your recent post in order on the front page of your site.  Front page Customize  on the your site. WordPress user want a static page as the front page instead.  This static page look is common for users desiring static page on the front page of the site. Login Page Custom WordPress

creating a static front page

 static front page

Blog posts on static front page

That worked great. Just for anyone finding this post, what I have accomplished is pulling in blog post content into a 'static' page template so that I have static content and blog content on the same page. Here is the code I used with both loops, the first being the blog content loop and the second being the standard page template loop for static content: Display Random Post 

<?php $my_query = "showposts=3"; $my_query = new WP_Query($my_query); ?>
<?php if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); ?>

 <!-- standard tags to display blog post information like the_title() here -->

<?php endwhile; // end of one post ?>
<?php endif; //end of loop ?>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

 <!-- standard tags to display the static page information like the_title() here -->

<?php endwhile; endif; ?>

Only show sidebar on home page

edit your sidebar.php file, found in the theme files in the /wp-content/themes/{theme-name} folder

put this as the first line:

<?php if ( is_front_page() ) { ?>
and this as the last line:
<?php } ?>
That will cause the sidebar contents to only display on your home page.

<?php }
else {

Wordpress Custom Login Form

Wordpress Custom Login Form


Wordpress Login Form Customized to fit and look nice  your own website branding.  This is even more significant for multi user or multi author blog, or sites whatever you customized first login form look very nice your site and you have set up for clients as adds that little extra something. Updated schema WordPress

Just used this plugin custom your WordPress login form BM Custom Login or search the another plugin custom Login

Change the Login Logo

To change the your WordPress site logo to your own,  you will need to change CSS styles associated with the heading.

<h1><a href="" title="Powered by WordPress">Your Site Name</a></h1>

CSS style  to displya background image the wordpress logo link and inside the heading tag.  You can use the login_enqueue_scripts hook to insert CSS into the head of the login page so your logo loads instead.  To use the code below replace the file name site-login-logo.png with the file-name of your logo and store your logo with your active Theme files in a directory named /img :

function my_login_logo() { ?>
    <style type="text/css">
        .login h1 a {
            background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/img/site-login-logo.png);
            padding-bottom: 30px;
<?php }
add_action( 'login_enqueue_scripts', 'my_login_logo' );
Your Logo size 80 * 80 pixels though even this can change with custom.css.  Adjest the above padding-bottom value to the spacing our want between your logo and the login form.  To change the link values so the logo links to your WordPress site, use the following WordPress hooks edit it and past it bellow the previous in functions.php

function my_login_logo_url() {
    return home_url();
add_filter( 'login_headerurl', 'my_login_logo_url' );

function my_login_logo_url_title() {
    return 'Your Site Name and Info';
add_filter( 'login_headertitle', 'my_login_logo_url_title' );

Styling Your Login

body.login {}
body.login div#login {}
body.login div#login h1 {}
body.login div#login h1 a {}
body.login div#login form#loginform {}
body.login div#login form#loginform p {}
body.login div#login form#loginform p label {}
body.login div#login form#loginform input {}
body.login div#login form#loginform input#user_login {}
body.login div#login form#loginform input#user_pass {}
body.login div#login form#loginform p.forgetmenot {}
body.login div#login form#loginform p.forgetmenot input#rememberme {}
body.login div#login form#loginform p.submit {}
body.login div#login form#loginform p.submit input#wp-submit {}
body.login div#login p#nav {}
body.login div#login p#nav a {}
body.login div#login p#backtoblog {}
body.login div#login p#backtoblog a {}
WordPress uses the CSS style sheet wp-admin.css to insert the logo and to hide the heading text with text-indent:-9999px;

.login h1 a {
 background-image: url('../images/w-logo-blue.png?ver=20131202');
 background-image: none, url('../images/wordpress-logo.svg?ver=20131107');
 background-size: 80px 80px;
 background-position: center top;
 background-repeat: no-repeat;
 color: #999;
 height: 80px;
 font-size: 20px;
 font-weight: normal;
 line-height: 1.3em;
 margin: 0 auto 25px;
 padding: 0;
 text-decoration: none;
 width: 80px;
 text-indent: -9999px;
 outline: none;
 overflow: hidden;
 display: block;