• Home
  • About me
  • Gallery
  • WordPress
  • Life
  • Contact us

Laxman Prajapati

~ WordPress Blog

Laxman Prajapati

Author Archives: Laxman Prajapati

How to install Twnety Twenty theme on WordPress Website?

19 Tuesday Nov 2019

Posted by Laxman Prajapati in WordPress

≈ Leave a comment

  • For safer side, take backup of your current website.
  • Go to: appearance > Themes > Search “Twenty Twenty” > try “Live Preview” > activate.
  • For theme customisation, go to: : appearance > Themes > Customise > Site Identity > Colors > Theme Options > Cover Template > Background image > Menu > Widgets > Homepage Settings > Additional CSS.
  • After successful installation, click on heart bottom (on top right corner above download button) and subscribe to the theme.
  • Kindly share your feedback by writing theme review and giving rating out of 5.
  • You can write theme review, check support forum, and submit an issue (if any).

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

How to download PDF file using WordPress codex

24 Saturday Aug 2019

Posted by Laxman Prajapati in WordPress

≈ Leave a comment

images

<?php
/* Template Name: PDF */
?>
<?php
// place this code inside a php file and call it f.e. "download.php"
$uploads = wp_upload_dir();
$ppp = explode('/', $uploads[path]);
$path = "/".$ppp[1]."/".$ppp[2]."/".$ppp[3]."/".$ppp[4]."/".$ppp[5]."/".$ppp[6]."/09/";
//$path = $uploads['path']."/"; // change the path to fit your websites document structure
$fullPath = $path.$_GET['download_file'].".pdf";
if ($fd = fopen ($fullPath, "r")) {
    $fsize = filesize($fullPath);
    $path_parts = pathinfo($fullPath);
    $ext = strtolower($path_parts["extension"]);
    switch ($ext) {
        case "pdf":
        header("Content-type: application/pdf"); // add here more headers for diff. extensions
        header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\""); // use 'attachment' to force a download
        break;
        default;
        header("Content-type: application/octet-stream");
        header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
    }
    header("Content-length: $fsize");
    header("Cache-control: private"); //use this to open files directly
    while(!feof($fd)) {
        $buffer = fread($fd, 2048);
        echo $buffer;
    }
}
fclose ($fd);
exit;
// example: place this kind of link into the document where the file download is offered:
// <a href="download.php?download_file=some_file.pdf">Download here</a>
?>
<a href="pdf?download_fileq=<?php echo $filed_name[0]; ?>" ><img src="<?php bloginfo('template_directory') ?>/images/pdf.jpg" /><span class="pdf">Download the <?php echo $filed_name[0]; ?></span></a>

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

New Gallery Widget in WordPress 4.9

23 Saturday Jun 2018

Posted by Laxman Prajapati in WordPress

≈ Leave a comment

WordPress 4.8 introduced new media widgets which included rich text, audio, image, and video. WordPress 4.9 builds up on that with the introduction of the new gallery widget.

gallerywidget

This new widgets allows you to create a native WordPress gallery and add it to your WordPress sidebar or any widget ready areas.

Just like the native WordPress galleries, this widget is also limited in terms of functionality.

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

Template Hierarchy

02 Thursday Nov 2017

Posted by Laxman Prajapati in WordPress

≈ Leave a comment

Overview

WordPress uses the query string to decide which template or set of templates should be used to display the page. The query string is information that is contained in the link to each part of your website. It comes after the initial question mark and may contain a number of parameters separated by ampersands.

Put simply, WordPress searches down through the template hierarchy until it finds a matching template file. To determine which template file to use, WordPress:

  1. Matches every query string to a query type to decide which page is being requested (for example, a search page, a category page, etc);
  2. Selects the template in the order determined by the template hierarchy;
  3. Looks for template files with specific names in the current theme’s directory and uses the first matching template file as specified by the hierarchy.

With the exception of the basic index.php template file, you can choose whether you want to implement a particular template file or not.

If WordPress cannot find a template file with a matching name, it will skip to the next file in the hierarchy. If WordPress cannot find any matching template file, the theme’s index.php file will be used.

Visual Overview

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

Image

WordPress Work Sheet

13 Thursday Apr 2017

wordpress-cheat-sheet.pdf.png

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

Posted by Laxman Prajapati | Filed under WordPress

≈ Leave a comment

Merry Christmas

26 Monday Dec 2016

Posted by Laxman Prajapati in Family

≈ Leave a comment

I hope you know how much I value your friendship. I wish you a very merry Christmas and may we enjoy many more years together as friends.

funny-christmas-quotes

 

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

#SRK

16 Wednesday Nov 2016

Posted by Laxman Prajapati in WordPress

≈ Leave a comment

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

Image

WordPress Anniversary today!

15 Tuesday Nov 2016

Three years ago I found WordPress and signed up.

1280px-wordpress_10th_anniversary_8863260113

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

Posted by Laxman Prajapati | Filed under WordPress

≈ 2 Comments

Image

Happy Children’s Day

14 Monday Nov 2016

childrens-day

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

Posted by Laxman Prajapati | Filed under WordPress

≈ Leave a comment

Custom post list ( Member ) with pagination

13 Tuesday Sep 2016

Posted by Laxman Prajapati in WordPress

≈ Leave a comment

<?php 
/* 
Template Name: View All Members 
*/ 
?>
<?php get_header(); ?>

<?php $big = 999999999;
$args = array(
'post_type' => 'wp_member',
'country' => $country,
'meta_query' => $meta_query,
'posts_per_page' => '8',
'paged' => $paged
);

$wp_query = new WP_Query( $args );
while ( have_posts() ) : the_post(); 
// Code
endwhile;

<?php echo paginate_links( array('base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),'format' => '?paged=%#%','current' => max( 1, get_query_var('paged') ),'total' => $wp_query->max_num_pages) ); ?>

<?php get_footer(); ?>

 

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

Disable plugin update

15 Friday Jul 2016

Posted by Laxman Prajapati in WordPress

≈ Leave a comment

disablepluginupdates

Disable plugin update Add this code in your plugin root file.

add_filter('site_transient_update_plugins', 'remove_update_notification');
function remove_update_notification($value) {
     unset($value->response[ plugin_basename(__FILE__) ]);
     return $value;
} 

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

Add Post Meta Box In Admin

14 Thursday Jul 2016

Posted by Laxman Prajapati in WordPress

≈ Leave a comment

/*-------------- Called Post Meta -----------------*/
function meta_box_part()
{
    add_meta_box("meta-box-section", "Section List", "custom_meta_box_markup_section", "your-post-type", "side", "high", null);
}
add_action("add_meta_boxes", "meta_box_part");

/*-------------- Add Post Meta -----------------*/
function custom_meta_box_markup_section($object)
{
    // code goes here...
    
}

/*-------------- Save Post Meta -----------------*/
function save_custom_meta_box($post_id, $post, $update){
     if (!isset($_POST["meta-box-nonce"]) || !wp_verify_nonce($_POST["meta-box-nonce"], basename(__FILE__)))
        return $post_id;

     if(!current_user_can("edit_post", $post_id))
        return $post_id;

     if(defined("DOING_AUTOSAVE") && DOING_AUTOSAVE)
        return $post_id;

     $meta_box_value = "";
     if(isset($_POST["custom_input"])){
	$meta_box_value = $_POST["custom_input"];
     }  else{
	$meta_box_value = '';
     } 
     update_post_meta($post_id, "custom_meta_name", $meta_box_value);
}
add_action("save_post", "save_custom_meta_box", 10, 3);

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

HAPPY NEW YEAR 2016

31 Thursday Dec 2015

Posted by Laxman Prajapati in Happy new year

≈ 2 Comments

Best enjoyed with family and friends. Spread the New Year spirit and share the joy and happiness. Hope this New Year brings to you a magical touch of various treats and pampers you with several surprise presents. Enjoy and don’t miss this opportunity of sending warm wishes to your near and dear ones. Happy New Year 2015 to everyone out there and cheers! Friends if are searching for Funny 2015 Happy New Year

happy-new-years-eve-2016-images

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

Merry Christmas

25 Friday Dec 2015

Posted by Laxman Prajapati in Happy new year

≈ Leave a comment

Merry-Christmas-Wish-22

MERRY CHRISTMAS WISHES:

The month of Christmas has already come. People are counting on weeks, days, hours, minutes, and seconds to the day of Christmas Eve. Christmas is a season of giving where the people come out and give their heartful to the poor. It is the day to forgive. It is the day to forget all the sore things and start a new life with new hopes and wishes. Christmas is about keeping Jesus in the heart for the entire year and doing good deeds all the time. On the day of Christmas with the bells ringing and people singing it would be a delight to watch. People come together in Joyce and praise the lord for the beautiful life he presented us with. With loads of love towards Jesus people come and deliver their lovable prayers to him.

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...

Create New Pluging

21 Monday Dec 2015

Posted by Laxman Prajapati in WordPress

≈ Leave a comment


/**
 * Plugin Name: Ceremony Entry
 * Plugin URI: 
 * Description: FormEntry Plugin.
 * Version: The Plugin's Version Number, e.g.: 1.0
 * Author: 
 * Author URI: 
 * License: A "Slug" license name e.g. GPL2
 */

session_start();
add_action( 'admin_menu', 'ceremony_entry' );

function ceremony_entry() {
	add_menu_page('Ceremony Entry', 'Ceremony Entry', 'manage_options', 'my-top-level-handle', 'back_entry');
	add_submenu_page('', 'Edit Entry', 'Edit Entry', 'manage_options', 'edit-entry', 'edit_entry');
	add_submenu_page('', 'View Entry', 'View Entry', 'manage_options', 'view-entry', 'view_entry');
	add_submenu_page('', 'Delete Entry', 'Delete Entry', 'manage_options', 'delete-entry', 'delete_entry');
}
require_once(ABSPATH . WPINC . '/registration.php');
global $wpdb, $user_ID;
function edit_entry() {
// Code
}

function view_entry() {
// Code
}

function delete_entry() { 
// Code
}

function back_entry() {
// Code
}

Rate this:

Share this:

  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
  • Email
  • Print

Like this:

Like Loading...
← Older posts
Follow Laxman Prajapati on WordPress.com

About Me

Laxman Prajapati

Laxman Prajapati

Have to lose something to gain something

View Full Profile →

Total Blog Hits

  • 26,957 Views

Fish

Calendar

December 2019
M T W T F S S
« Nov    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Logo

wordpress-logo-stacked-rgb

Category

Animal Anniversary birthday Blog BuddyPress Family Flower Friends Goal Google Happiness Happy new year Health Independence Day Life Love Mind Fresh Natural PHP Positive Republic Day WordPress

Blogs I Follow

Success Life

“Success is not final, failure is not fatal: it is the courage to continue that counts.” ― Winston Churchill
“If at first you don't succeed, try, try again. Then quit. No use being a damn fool about it.” ― W. C. Fields
“Nearly all men can stand adversity, but if you want to test a man's character, give him power.” ― Abraham Lincoln
“Success is most often achieved by those who don't know that failure is inevitable.” ― Coco Chanel

Recent Posts

  • How to install Twnety Twenty theme on WordPress Website?
  • How to download PDF file using WordPress codex
  • New Gallery Widget in WordPress 4.9
  • Template Hierarchy
  • WordPress Work Sheet
  • Merry Christmas
  • #SRK
  • WordPress Anniversary today!

Posts I Like

  • ૪૧ on Tianu Gujarati Blog - Anurag Rathod
  • Announcing WordCamp Ahmedabad… on WordCamp Ahmedabad 2019 a.k.a 3.0
  • Call for Volunteers on WordCamp Ahmedabad 2019 a.k.a 3.0

Category

Animal Anniversary birthday Blog BuddyPress Family Flower Friends Goal Google Happiness Happy new year Health Independence Day Life Love Mind Fresh Natural PHP Positive Republic Day WordPress

Gallery

success-secrets-1
success
tree_success
15_5_orig
success-1
succaess
sucscess
success
success2

Create a free website or blog at WordPress.com.

WordCamp Ahmedabad 2019 a.k.a 3.0

#WCAhmedabad

Hinal Sanghvi

Hinal Sanghvi

WordPress Educator Zac Gordon

A Blog for Tutorials, Free Videos, and Updates on Courses, Talks and Workshops

seenu625

love nature, and all things creative

Hello Beautiful Book Blog

beautiful nerdy bookish things

How Useful It Is

Trying to be Useful, one post at a time!

vlandaman.wordpress.com/

On Becoming Fearless

Dreaming, believing, learning then achieving

Dil Ki Kitaab ( दिल की किताब )

darshandesai54

Online marketing

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.
Cancel
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
%d bloggers like this: