I have created a quick contact form php file where visitor click it slides out a contact form to fill the details ,to add in right sidebar how to add in every pages and post any help how to add in every pages
I have created a quick contact form php file where visitor click it slides out a contact form to fill the details ,to add in right sidebar how to add in every pages and post any help how to add in every pages
There are three ways to do that:
Create a widget (Recommended)
Here is official documentation. You can include your php file within widget()
function of your widget class.
Create and place a shortcode in exiting wordpress default text widget.
Here is sample code
//Place this code in theme's functions.php
add_shortcode('ContactForm', 'cf_shortcode');
function cf_shortcode($att) {
ob_start();
include "path/to/php/file";
return ob_get_clean();
}
Then place [ContactForm]
in wordpress default text widget.
Create a child theme and override sidebar.php file of your theme there.