Author: Narender Singh

Myself Narender Singh Thakur ( NST ) and i share my Experience/Knowledge and Tricks for folks and beginners to solve their issues while making websites through this Planet.

How to add survey form in wpform plugin in wordpress ?

Other Queries related to this Topic ….

  • How to add Quiz form using WPForms plugin ?
  • How to create form in wordpress ?
  • How to add Survey form to wordrpess ?

So here are the Steps to follow you to create a survery form in wordrpess using WPForms plugin.

Okay... Click on WPForms and then click on Add New button like below….

After that new window will be like below and give a name to your form as i added in (1) in screenshot and search the form by adding text “survey” like left area text field.. to add a Survey form template there….

New window will be like this… click on the filed to edit..

You can check the field name there and edit or add as per need..

Check the Preview of the form…. by click on Preview button..

After hit on Save button you can embed this form by following 3 method …
1) Using shortcode .
2) By selecting existing page.
3) By adding new page there.


1) Click on Embed button and copy the shortcode like below…and paste this on the page where you want to show the form.

2) Add form by Selecting the existing page option…

Select page from the dropdown list…

3) By creating new page there…

After this … Check the preview of the form…

That’s it ..πŸ˜‡

I hope this helps you …. Fell free to contact with us… πŸ˜‡

Thanks πŸ™

MySQL showing table is marked as crashed – WordPress Database!

Other Topics

  1. How to fix Mysql table marked as crashed?
  2. Table is marked as crashed and should be repaired ?

Today i noticed that one of my wordpress website showing nothing in dashboard ..

All pages / posts are disappeared and showing 0 pages there and also Media files are empty.

I really don’t know what was the issue and even i am not able to add new post or page there. πŸ™

Then I decided to solve this by making debugging mode ON in WordPress.

After that i got errors on the website that ….

./DB_NAME/wp_posts' is marked as crashed and should be repaired 

Then i logged in website cPanel and visit phpMyadmin area to check database.

I noticed there … it says wp_posts is “in use” in tables.

After that i checked this table and selected the dropdown option “Repair table” from bottom.

Like here…..

Now i checked again website and looks working as normal and also i am able to add new pages and posts there too.

Media files are also showing now there. 😊

I hope this helps you … Just message me if you need any further help.

Thanks πŸ˜ŠπŸ™

How to Disable WordPress Block Widgets and use old style Classic Widgets again ?

If you are also struggling with block-based widget style then this post will help to revert that new style widgets to old style. Means Classic style widget.

It’s very easy to disable WordPress block widgets. Using Plugins and using without plugin.

Using Plugin

Using this plugin Classic Widgets . Just add and activate this plugin.. it will auto revert to old style widgets view.

Using without plugin..

If you don’t want to use plugin then just add this simple code to your activate theme functions.php and hit on Update file button.

// revert to classic widget view ( Old View)
function nst_theme_support() {
    remove_theme_support( 'widgets-block-editor' );
}
add_action( 'after_setup_theme', 'nst_theme_support' );

After doing one of step above.. the result will be like this.. as before..

If you need any help just message me through form or chat box.

Thanks πŸ™πŸ˜Š

Woo-Commerce Missing Coupon menu (even after “enable use of coupon code”) in wordpress

Other queries related to this topic ..

1) Create Coupon not showing up under Woocommerce

2) In wordpress .. woocommerce coupon option missing.

And here is the solution for all of these..

Few days before i updated my woocommerce shop and after that i notice coupon is disappear from the menu.

Then i checked woo-commerce General tab to confirm if the coupon option is enable or not …

woocommerce coupon mising

Then scroll down to here…

enable use of coupon woocommerce

Okay.. it was enabled there and then i noticed that the coupon option is moved to under Marketing menu.. check below..

coupon option in woocommerce wp

Sometime it’s also shows under woo-commerce menu too..

under woocommerce coupon

That’s it .. if this is still missing then contact with me or with the plugin administrator. πŸ™‚

Thanks πŸ™

How to show all child pages of a specific wordpress page ?

Here are some other queries related to this topic …

How to show child pages of a parent page wordpress?

Show all pages of a parent page wp ?

How to display list of child pages of parent page in wordpress ?

How to get all child pages of a parent page in wordpress ?

Solution For all the above queries is ….

There are many way to show the child pages… One of them is using plugins… but i am going to do this using wp query function… I mean without plugin.

So first of all you need to login to website and go to Apearance > Theme Editor Functions.php file.

You have to add the below script to your active theme functions.php file…

get child pages of parent page wordpress through functions.php file

The wp query script below show only page title and excerpt only… you can add as per you need.

<?php
// Child pages of parent page to show in order
function parent_child_pages(){
      global $post;
	$args = array(
    'post_type'      => 'page', 
    'posts_per_page' => -1,
    'post_parent'    => '15', //place here id of your parent page	
    'order'          => 'ASC',
    'orderby'        => 'title'
 ); 
 
$childlist = new WP_Query( $args );
 
if ( $childlist->have_posts() ) : ?>

<ul class="childpages">
<?php while ( $childlist->have_posts() ) : $childlist->the_post();  ?>
<li id="child-<?php the_ID(); ?>">
  <h4><a href="<?php the_permalink();?>">
    <?php the_title();?>
    </a></h4>
  <div class="excerpt">
    <?php the_excerpt(); ?>
  </div>
  </li>
  <?php endwhile; 
	echo '</ul>';
            endif; 		 
        wp_reset_query(); 
}

//shortcode here
function parent_child_pages_shortcode($atts, $content = null) {
    ob_start();
    parent_child_pages();
	$out = ob_get_contents();
	ob_end_clean();
	return $out;
}

add_shortcode('parent_child_short','parent_child_pages_shortcode');
?>

Don’t forgot to change the ‘post_parent‘ id in your code… as defined below screenshot..

If you don’t know the how to find the ID of page then follow this tutorial ..

The above wp query is for page post type you can change that type to any custom post type to show your result.

After hit on save button..

Add the Shortcode [parent_child_short] in your page or post or wherever you want to show the result.

child pages of parent page wordpress

You can also add featured image or custom field script there to show in the result…. here is that…

For Featured image add this..

 <?php the_post_thumbnail();?>

For Custom filed value add this ..

<?php echo get_post_meta($post->ID, 'key', true); ?>

You can read more about how to get custom fields value from this topic.

If you don’t want to show or exclude some of them pages in the list then add this to query…

'post__not_in' => array( 143, 17),

You can add page ID‘s by using comma’s like below…. to exclude the pages

exclude the page

I hope this will help you.. πŸ™‚

Feel Free to ask any query … Thanks πŸ™

How to find ID of posts or pages in wordpress ?

Other Queries …

How to check the ID of pages or posts in wp?

How to show or get ID of pages and posts in wordpress?

Here is simple way to check that…

From Dashboard of the website.

Go to all pages or all posts or your custom post type to check ID‘s.

and hover on the title of any post and then it will show the ID in the bottom.. like screenshot below..

From front-end of the website…

Just open the post or page in single view and right click of the mouse and then choose option Inspect in browsers.

After click on that option…. it slide from the bottom. by default…

As above screenshot you can find your opened page ID in both places.

I hope this will help you …. πŸ™‚

Feel Free to ask any query… Thanks πŸ™

WordPress theme appearing or loading issue in dashboard – The7

Sometime if you face the issue of theme not showing correctly in dashboard… like screenshot is showing like the below etc..

the7 theme issue

So if you have the same issue just go to cpanel or connect to files through FTP.

And change the current live theme folder permission to 755 like below..

change permission wp

change folder permission

After apply this just goto wp dashboard and check there.. the issue will be gone.

I hope this helps you alot.. if still facing issue just contact with theme support person.

Or in any customization help related to wp theme just contact with me using form or chat box.

Thanks

add JS or CSS to website using functions.php file in wordpress!

How to properly add style and script to your wp website using functions.php file ?

Sometime we want to add CSS or JS to front-end of website without editing the parent theme files. like header.php or footer.php

So here is the simple function that help to add or apply your custom CSS code or js code to your front of website.

So here is code to add custom style to your website.

Note: Create a folder in your activate theme ( if not there ) with name CSS and a new file under that folder with name custom.css … so path will be like /css/custom.css .

Now add the bottom code in you functions.php file and hit on save button.

apply custom css to wp using functions file wp_enqueue
<?php 
function nst_custom_css(){
      $nst_csssrc = get_stylesheet_directory_uri() . '/css/custom.css';
      wp_enqueue_script( 'nst_custom_css', $nst_src , array(), '1.0',  false );   
}
add_action( 'wp_enqueue_scripts', 'nst_custom_css' );
?>

Now you can add your custom styles in your new file. πŸ™‚

Now the way to add Js code to your wp using functions file…

Like above

Note: Create a folder in your activate theme ( if not there ) with name JS and a new file under that folder with name custom.js … so path will be like /js/custom.js .

<?php
function nst_custom_js(){
      $nst_jssrc = get_stylesheet_directory_uri() . '/js/custom.js';
      wp_enqueue_script( 'nst_custom_js', $nst_src , array(), '1.0',  true );   
}
add_action( 'wp_enqueue_scripts', 'nst_custom_js' ); ?>

Now you can add your custom scripts in your new file. πŸ™‚

Just contact me if you still need help regarding this or any other issues.

Thanks πŸ™

Make changes in database after import to live wordpress!

Simple steps to make changes in database after import to live in wordpress or import to new domain , place, hosting.

Quickly change your wordpress database from the cpanel / phpmyadmin.

Here are simple code you have to edit and paste into your domain database SQL tab and then click on GO to process it..

Here is the code

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');


Steps to follow :-

  1. As you see the above code.. you have to change the url of the domain path as per OLD and NEW.
  2. http://www.oldurl is path of where from you want to move.
  3. http://www.newurl new path of where you want to install or move.

Also please check the table prefix of your database.. if it is started with “wp_” then it’s okay other wise change this too as per your tables.

Click here ..how to check used database table prefix

Go to database and click on the database is used.

After this click on SQL tab and paste the above code .. i mean the one you changed now as per new and old url.

Like here ..

1) Click on used database
2) Then click on “SQL” tab.
3) Then paste the code in query box.
4) After this hit the “Go” button .. right side of the query box.
5) it will show you Successfully done message when the query is completed.

That’s it .. i hope this helps you and if still has any confusion then please contact me by chat box or contact forms.

Click to Chat