WP Facebook Messenger

FACEBOOK MESSENGER FOR WORDPRESS Fastest way to get connected For any sellers and business owners!

Woocommerce

WOOCOMPOSER Page Builder for WooCommerce WooCommerce Page Builder is The Quickest Way to Create from Product Detail Page to Thank-You Page and Everything in Between.

Facebook Live Chat For Wordpress

FACEBOOK LIVE CHAT FOR WORDPRESS The Very First Step of The 2017 Facebook Marketing Strategy

Yoast SEO

WordPress out of the box is already technically quite a good platform for SEO.

Contact Form 7 Multi-Step

CONTACT FORM 7 MULTI-STEP Featured on our Best WordPress Plugins Adding steps for your complex form The best solution to keep the form clean and simple to your visitors

Wednesday, July 26, 2017

How to create shortcode from A to Z

How to create shortcode from A to Z


What is shortcode?

The shortcode is a short piece of code, This short code will do something that you set at creation of the shortcode, Eg show a loop, You can make this shortcode anywhere in the post, in the theme, except Excerpt and Widget.
Today shortcode is used quite commonly you can go to the wordpress plugins library and look for plugins with the shortcode keyword there are many plugins to appear it supports you with a number of full-length shortcodes required from decorating articles to making the tasks more complex.
And in many themes for wordpress it also supports some of its shortcode.

How to create a shortcode

All the code in this article you write into the functions.php file of the theme nhé.
To create a shortcode, we will have two main steps.
Step 1: Set the code execution function in the shortcode.
Step 2: Creates a shortcode based on the function created.
To figure out I'm going to give you a sample of this shortcode

//Initialize function for shortcode
function create_shortcode() {
        echo "Hello World!";
}
// Create a shortcode named [test_shortcode] and execute the code from the create_shortcode function
Add_shortcode ('test_shortcode', 'create_shortcode');
What matters is that I've put it all into code, Now if you write [test_shortcode] in the article content, Then it will show the hello world! instead of the shortcode you just wrote.
But one problem is the word Hello World! It will always be at the top of the article as we use the echo command.
If you want to show it right place the shortcode, you must use the return statement instead of echo.
You can fix echo "Hello World!" to return "Hello World!" Later when you write shortcode you should avoid using echo.
Similarly, we apply a little knowledge of Loop and Query to create a shortcode display 10 random articles offline.

function create_shortcode_randompost() {

        $random_query = new WP_Query(array(
                'posts_per_page' => 10,
                'orderby' => 'rand'
        ));

        ob_start();
        if ( $random_query->have_posts() ) :
                "<ol>";
                while ( $random_query->have_posts() ) :
                        $random_query->the_post();?>

                                <li><a href="<?php the_permalink(); ?>"><h5><?php the_title(); ?></h5></a></li>

                <?php endwhile;
                "</ol>";
        endif;
        $list_post = ob_get_contents(); // Take the entire contents above the $ list_post variable to return        

         ob_end_clean();

        return $list_post;
}
add_shortcode('random_post', 'create_shortcode_randompost');


You can see from paragraph 8 to paragraph 21 I wrote the loop in the function ob_start() and ob_end_clean(). Actually here I have to cache anything I’ll wrap that part to use the function ob_get_contents() Go to the $ list_post variable, then return this variable out because when you do shortcode you must use return. If anyone has a better way, let me know.
Now you write [random_post] the location where you need to display the list of random items is ok.

Create a shortcode using the parameter

In the previous section we only learn by creating a simple shortcode, which means it only shows what we wrote in the shortcode that does not allow customization of the user. If you want to let the user manually edit what is displayed, here we have to use the parameters.
For example, in the shortcode above we have shown 10 random posts. But if using the parameter, we can let the user customize the parameter in the number of posts displayed and can choose the sort order if you want.
To create a shortcode containing the parameters we create as follows.

function create_shortcode_ parameters1 ($args, $content) {
        return " this is number". $args[' parameters1'];
}
add_shortcode( 'shortcode_ parameters1', 'create_shortcode_ parameters1' );
First, in the function part, we have two arguments  $args and $content. The $args variable is the shortcode parameter and the  $content variable is the piece of content wrapped in code. You see the example below:
[shortcode_thamso thamso1="100]Đây là biến $content[/shortcode]
Thus, we have thamso1 as parameter and number 100 means the value of any parameter that the user can set. $content is wrapped inside the shortcode, but in the above paragraph we do not use the $content variable to print so even if you write like that, the $content section is not showing up yet.
Now you write the shortcode on the article it will show "this is 100" right, And that also makes the parameter shortcode.

function create_shortcode_tinhtong($args, $content) {
        $tong = $args['term1'] + $args['term2'];
        return "Total".$tong;
}
add_shortcode( 'total', 'create_shortcode_total' );
And when writing the shortcode we will write the following.
function create_shortcode_content($args, $content) {
        return strtoupper($content); //Prints all the content in the shortcode }
add_shortcode('shortcode_content', 'create_shortcode_content');
And now you try to write in this shortcode.
[shortcode_content]Viết cái gì đó vào đây[/shortcode_content]
Has it printed the entire text in the body of the shortcode?

So why does the example above use only $ content but have to declare both $ args? Because by default, if you just declare a parameter, it will know for itself that the variable is the first parameter, so it's best to declare both variables, of course you can set any name.
Summary:
$ Args will have a parameter structure of $ args ['arguments'], and the suffix is the parameter in the shortcode that you have to write in the same way.
$ Content is the variable that prints the entire contents of the open shortcode and shortcode tags.

How to write a shortcode into a PHP file

Shortcode only executes in the WordPress editor, but in other situations it does not understand. So if you want to insert a shortcode into a PHP file, you must use the do_shortcode () function to execute it. For example:
<?php echo do_shortcode('[test_shortcode]'); ?>

Examples of shortcode examples


Shortcode displays video from Youtube


By default, the embed code from YouTube will look like this.
01
<iframe src="//www.youtube.com/embed/0KJ60uJZ3-Q" height="480" width="640" allowfullscreen="" frameborder="0"></iframe>
So here we play three parameters:

Enter the ID of the video.
Parameter to adjust the width of the video.
Video horizontal adjustment parameter.
Ok let’t do it.

function create_youtube_shortcode( $args, $content ) {
        $content = '<iframe src="//www.youtube.com/embed/'.$args['id'].'" height=" '.$args['height'].'" width="'.$args['width'].'" allowfullscreen="" frameborder="0"></iframe>';
 return $content;
}
add_shortcode('youtube', 'create_youtube_shortcode');
And the shortcode would look like this:
[/youtube width="500" height="300" id="0KJ60uJZ3-Q"]
It will manually pass the parameters you entered into the shortcode.

Insert a full color notification box

This example will work with $ content in the shortcode.


function create_notification _shortcode($args, $content) {
        return "
<div class='notification '>".$content."</div>
";
}
add_shortcode( 'notification ', 'create_notification _shortcode' );

And add a little CSS to the style.css file

.thongbao {
     background: #585858;
     padding: 1.5em 2em;
     color: #FFF;
     border: 1px solid #C7C7C7;
}
Ok, now you can write in the content is [thongbao]Nội dung thông báo[/thongbao] Then see the results offline.

Shortcode retrieves Facebook information

In this example, the code will be a little too long to use get content from JSON through Facebook Graph. The shortcode structure will be [\fbgraph username="thachpham92"] The thachpham92 means the input parameter, ie the Facebook username needs to be displayed.

function create_fbgraph_shortcode($args, $content) {
        $get_info = wp_remote_get('https://graph.facebook.com/'.$args['username']);
        $get_avatar = "https://graph.facebook.com/".$args['username']."/picture?type=large";
        $dc_info = json_decode($get_info['body'], true);
        $dc_avatar = json_decode($get_avatar['data'], true);

        // Make variables easy to handle.
        $fb_id = $dc_info['id'];
        $fb_username = $dc_info['username'];
        $fb_url = $dc_info['link'];
        $fb_name = $dc_info['first_name'];
        // Write gender.
        if ($dc_info['gender'] == 'male') {
                $fb_gender = "male";
        } else if ($dc_info['gender'] == female) {
                $fb_gender = "female";
        } else {
                $fb_gender = " Undefined!";
        }

        ob_start();?>
<div class="fb-info">
<h5>your information <?php echo $fb_name; ?></h5>
<div class="avatar"><img alt="" src="<?php echo $get_avatar; ?>" /></div>
<div class="info"><strong>your ID: </strong> <?php echo $fb_id; ?>
 <strong>Username: </strong> <?php echo $fb_username; ?>
 <strong>sex: </strong> <?php echo $fb_gender; ?></div>
</div>
        <?php
        $result = ob_get_contents();
        ob_end_clean();

        return $result;

}
add_shortcode( 'fbgraph', 'create_fbgraph_shortcode' );

And a little CSS like demo

.fb-info {
overflow: hidden;
padding: 0.5em 1em;
background: #3B5998;
border: 1px solid #E8E8E8;
color: #FFF;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
.fb-info .avatar {
width: 30%;
float: left;
margin-right: 5%;
padding: 10px;
background: #FFF;
border: 1px solid #F3F3F3;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
.fb-info .info {
width: 60%;
float: right;
}
Ok, let's try it.

Last words

Thus, in this article you already know through how to create a shortcode basically like, then create a shortcode that use parameters and I also explained quite thoroughly about it (should post it new long this) .

Really shortcode in WordPress is an extremely powerful feature for you to insert something into the post quickly. But be careful when using it because if you have users in multiple threads, later you do not want it anymore shortcode off, then to really tired.


If you still have questions, please leave a comment offline.

Monday, July 24, 2017

11 plugins must have for a wordpress website.

As you all know. After installing wordpress successfully (if you have not installed can read Wordpress installation guide for newbie to install wordpress yourself) a wordpress website without a theme and no plugins for wordpress, then the website does not seem to have the soul and power.
So today HATACHI will list the 11 most needed plugins for wordpress, so you can learn and install.


JetPack a set of useful tools for wordpress web.

11 plugins must have for a wordpress website.
plugins JetPack for wordpress

In the list of essential plugins to install, JetPack must always be the top choice because of its robustness and feature richness. JetPack features many of the same from the wordpress.org  service, so this is a great solution for those who want to add features to your wordpress website.

JetPack features.

Manage multiple WordPress sites at the same time from WordPress.com.
Statistics visits per day.
Edit CSS with Custom CSS.
Login to the website using wordpress.com.
Manage authentication with Google Webmaster Tool.
Insert the posts share button social networking.
Spell check posts.
See detailed information about Gravatar when hovering over their avatars.
Create contact form.
Tiled Gallery - create beautiful photo gallery.
Share the article with a shortlink from wp.me.
Private interface to access the website by phone.
Type math formulas.
Add some widgets.
……. And much more.
See JetPack details here

Akismet anti-spam comment is extremely powerful.

11 plugins must have for a wordpress website.
akismet anti-spam

Comment spam is always considered a problem for those who own the wordpress website, and certainly no one likes this.
But spam must have a way to combat spam, and Akismet is seen as a superhero in the fight against spam.
Akismet is a spam free comment plugins for wordpress,  developed by Automattic.


Features Akismet.

The main and most important function of Akismet is the anti-spam comment on every wordpress website.

Advanced tinyMCE adds editor buttons to wordpress

11 plugins must have for a wordpress website.
tinyMCE

This plugin will let you add, remove and arrange the buttons that are shown on the Visual Editor toolbar. You can configure up to four rows of buttons including Font Sizes, Font Family, text and background colors, tables, etc. It will also let you enable the editor menu, see the screenshots.

It includes 15 plugins for TinyMCE that are automatically enabled or disabled depending on the buttons you have chosen. In addition this plugin adds some commonly used options as keeping the paragraph tags in the Text editor and importing the CSS classes from the theme’s editor-style.css.

Function of the Advanced tinyMCE

Support to create and edit the table.
More options when inserting lists.
Search and Replace in the editor.
Ability to set Font Family and Font Sizes.
And many others.

Yoast Seo support Seo for the best wordpress

11 plugins must have for a wordpress website.
Yoast Seo

When you have a wordpress website and you want to seo it up goole, Yoast Seo is a great choice for you.
Yoast seo is a very popular free plugin to help you easily optimize the title & description of your site's components, and this plugin also has many other SEO related features for you to use.
However, you should know that this is just a plugin to help you easily fine-tune the meta tag information to optimize the SEO, not to install the website will rank well.

Features of Yoast Seo

Show the information that gives you optimization advice.
Set the website name and metadata display name on your Google Knowledge Graph website.
Customize the title structure and meta description tag.
This section is where to set the title and description of the home page.
Reset the header structure and default description of post types within the website.
And much more.

WP Super Cache - Caching to speed up website.

11 plugins must have for a wordpress website.
wp super cache for wordpress

WP Super Cache is one of the best free plugins to support wordpress website acceleration with high technology thanks to caching. It often used for the web pages medium and medium used by HTML cache

Feature of WP Super Cache.

The main function is to speed up the page load of the wordpress website
See more details about WP Super Cache here.

IThemes Security - The most popular security plugin for WordPress.

11 plugins must have for a wordpress website.
iTheme security

Not long ago, the plugin for security support is quite well known. Better WP Security has enlightened into iTheme and has also changed its name to iTheme Security.
iThemes Security gives you over 30+ ways to secure and protect your WordPress site. On average, 30,000 new websites are hacked each day. WordPress sites can be an easy target for attacks because of plugin vulnerabilities, weak passwords and obsolete software.
ITheme Security was created to fix common vulnerabilities, stop attacks, and automatically enhance user credentials.

the Feature of iTheme Security.

Protect your users from attacks, and enhance the security of your system.


The basic options of iThemes Security

Write to File - This option will allow other plugins to automatically add content to the wp-config.php and .htaccess files, so you should select it to be able to install other features of iThemes Security or the cached plugin. Automatically.

Notification Email - Email address receiving notifications related to iThemes Security plugin, you can add multiple emails separated by a row.

Backup Delivery Email - Email address to receive backup files if you backup data with iThemes Securtity.

Host Lockout Message - Error message for those who logon failed due to IP lock.
User Lockout Message - Error message if member is locked.

Blacklist Repeat Offender - Enables the use of public address spam lists. You should choose because it will help you get rid of the spammers included in this list.

Blacklist Threshold - The number of times the IP is locked changes to a permanent lock.

Blacklist Lookback Period - The time limit for blocking spammers is listed in the Blacklist Repeat Offender section.

Lockout Period - Time each lock if someone tries to login but fails.
Lockout White List - The IP list is not locked.

Email Lockout Notifications - Email notifications when someone is locked.

Log Type - Log type of log activity of the plugin, should choose is Database Only.

Days to Keep Database Logs - The log period of the database logs, after which the logs will be deleted.

Path to Log Files.

Allow Data Tracking - Allows iThemes to collect your usage data for analysis.

Contact Form 7 Multi-Step create the best multi-step contact form

11 plugins must have for a wordpress website.
contact form 7 multi-step for wordpress site

The contact form 7 mutil-step can handle many simple multi-step contact forms, plus you can customize forms and text content flexibly with simple markers. Ajax submission form, CAPTCHA, Akismet spam filter, and so on.


Feature of Contact Form 7 Multi-Step

MAKE YOUR FORM CLEAN WITH MULTI-STEP
ADD STEP TAG TO YOUR FORM WITH A CLICK
CUSTOMIZABLE BUTTON FOR EACH STEP
UNLIMITED STEPS AVAILABLE
TRENDY MODERN UI / UX
6-MONTH FULL SUPPORT
EASY TO USE
AND MORE TO EXPLORE

For more information contact form 7 multi-step here

WP facebook messenger.

11 plugins must have for a wordpress website.
wp facebook messenger



When you and your visitors are looking for a way to talk to each other in a difficult way. Using wp facebook live chat can boost up sales, And help your business generate a large number of potential customers. Facebook messenger is a plugins for wordpress that you can connect with your visitors and help bnaj and visitors can talk directly to each other.


Feature of Wp facebook messenger

QUICK CONNECT this is the quickest and easiest way to help your customers communicate with your business through Facebook Messenger.

PROMOTE NOTICE you will receive a notification right in the fan page manager when new messages arrive.

WOOCOMMERCE COMPATIBLE  add a Messenger button to your product details, shopping cart, or thank you page to help buyers ask questions and find the support they need.

GOOD  the Messenger icon and button work perfectly on any desktop, tablet or mobile device.

Color is not limited simply select the color to ensure it fits into your current theme and matches your taste.

EASY SETUP installation takes only 20 seconds then you can customize any element you like.

For more information WP facebook messenger here

Responsive lightbox by dFactory - Create lightbox effect when click on image to view large image

11 plugins must have for a wordpress website.
lightbox

The lightbox effect is the effect when we click on a small photo, it will display a popup window to display the actual size of the image from your use of a plugins application in jQuery.
Responsive Lightbox by dFactory is a plugins commonly used for websites with many images, but do not want to insert images too large into the article.


FEATURES of Responsive lightbox by dFactory

Select from 7 responsive lightbox scripts (SwipeBox, prettyPhoto, FancyBox, Nivo Lightbox, Image Lightbox, Tos “R” Us, Featherlight)
Automatically add lightbox to WordPress image galleries
Automatically add lightbox to WordPress image links
Automatically add lightbox to WordPress video links (YouTube, Vimeo)
Automatically add lightbox to widgets content
Automatically add lightbox to WordPress comments content
WooCommerce product gallery support
Visual Composer compatibility
Gallery widget
Single image widget
Option to display single post images as a gallery
Option to modify native WP gallery links image size
Option to set gallery images title from image title, caption, alt or description
Option to force lightbox for custom WP gallery replacements like Jetpack tiled galleries
Option to trigger lightbox on custom jquery events
Option to conditionally load scripts and styles only on pages that have images or galleries in post content
Enter a selector for lightbox
Highly customizable settings for each of the lightbox scripts
Multisite support
Filter hook for embeddding different scripts based on any custom conditions (page, post, category, user id, etc.)

ReplyMe - Send a notification when someone responds to a comment

replyme plugins

When someone comments on your post Relyme will automatically send you an email reminding you new comments for you, and it will also automatically send you a reply email to the author, so you can customize the content to submit.

Features of ReplyME

The main feature is automatic email reply,
Support languages.
English
Turkish
Japanese
Polish language
Swedish
And so on

Facebook Messenger Chat with Bot

11 plugins must have for a wordpress website.
facebook messenger with bot

There are times when you are away or you are too busy to tl the message that the visitor message to you, you have peace of mind about that because there are plugins instead of you doing it in wordpress.
Facebook Messenger Chat with Bot for WordPress uses Facebook Messenger Bot API to
Helps you create an automated bot capable of responding to visitor messages.

Featurse of facebook messenger chat with bot.

WORK SMARTER work smart with Facebook's bot technology. You can determine how it works.

INTELLIGENT INTELLIGENCE FOR CREATIVITYY you are free to make this bot an intellectual source that is fully communicating with your visitors.

NEVER FORGET ANY POTENTIAL CUSTOMER stand out from the crowd, go too often, let your customers know how much you care about them.

INCREASE YOUR CUSTOMER SERVICE build positive emotions around your brand. Make customers feel happy and appreciated.

FULL REPLACEMENT TYPES many types of available responses include Text, List Post, Button, Generic, Receipt, Address, and so on

SAVE YOUR MONEY AND RECEIVE EFFECTIVE PERFORMANCE instead of hiring some employees, you only need this automated bot to ensure proper response for 24/7 visitors

EASY TO USE this plugin is easy to install 
and takes action. Simply save your time and support your customers in the whole process.

AND MORE...
These are the plugins that hitachi think you should install on your website no matter what field, of course, in addition to these plugins, you should also install other plugins that match the field you are operating.

For more information facebook messenger with bot here

Last words


These are the plugins that HATACHI think you should install on your website no matter what field, of course, in addition to these plugins, you should also install other plugins that match the field you are operating.

And for those who own the wordpress website for business, you should read 10 best live chat plugins you should have for wordpress. Because this article will help you get the best live chat support for wordpress and best for your website help you support and talk face to face with your customers, increase conversion rates.

Related Articles


 
loading...