There are three ways to do that:
-
Create a widget (Recommended)
Here is official documentation. You can include your php file withinwidget()
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.
Related Posts:
- WordPress twenty eleven sidebar on Pages
- Different “Text Widgets” in Sidebar on Many Different Pages?
- Registering multiple sidebars with data from an array
- Get Order of Meta Box in a Page/Post
- how to display sidebar on pages in wordpress
- creating single page with 2 columns while theme is 3 column
- If page or sub page not working as expected
- Check if sidebar is active on page with id
- How to exclude sidebar from pages?
- Page specific values in widgets
- how to list subpages in sidebar without widget
- How can I use Page editor for two separate templates?
- Get the content of a specific page (by ID)
- How to give paged links custom title?
- featured image as background image on pages
- Show Default Editor on Blog Page ( Administration Panel )
- Create pages automatically if they don’t exist
- Having different sidebar content for MANY pages?
- Can I display submenus in groups, using wp_list_pages?
- Order by menu_order and title?
- How to redirect on particular page in wordpress? [closed]
- Can I display the widget admin in the page admin?
- Internal Links to Pages in PHP?
- Restrict acceess of a page in backend
- Modify theme to get page excerpts on front page
- get_page_by_title not working when used with a variable
- Debugging shortcode problems
- How to make certain page templates visible to admin only
- Editing Pages that Have Already Been Published
- How to show post(excerpt) from specific category on wp page?
- The entire content of my WordPress page has disappeared
- What is the proper way to get contents of a page?
- Getting child content
- Clean URL link for page without number
- Can I include Javascript/jQuery in a page?
- Adminbar Missing “Edit Page”
- conditional tags- how to use with shortcodes
- How to show different widgets on different pages in a user friendly way
- List all private pages user has access rights to read
- How to update the counter of private pages in the dashboard?
- Any Ideas for Including “More Tag” with get_pages($args)?
- Using in-build Visual Composer param types in custom param types
- Google Analytics tracking code on just one page?
- Displaying different page links on different pages
- get_pages() as per custom menu order
- Pass data from one page to anothe file/page in wordpress
- Display child pages in sidebar of parent page in wordpress
- Get the Current Page Slug-Name
- How to use is_admin in page content?
- Adding a Calculator to a WordPress Page
- List all posts with the parent or grandparent of a page with a specified ID
- From a developer’s point of view what are the differences between pages and posts? [closed]
- block a page from logged out users and redirect to homepage
- Disable ADD PDF media button on rich text editor
- Page titles for internal classification of landing pages
- Function to incorporate an option in each Page
- How to properly enable comments form in page template
- Displaying direct children of other pages on homepage
- How do I reference the front page’s parent Page object?
- How to bypass 404 for certain pages/posts?
- Displaying Current Page Number Conditionally
- Multiple Loops That Pull Pages (Child/Grandchild) While Styling the First Entry
- How do i pick the pages in 20-11 header?
- trying to add a author value in wp page links?
- Check if has pages?
- How to show page title with capitalization only as I typed in?
- Create custom page to author.php
- Make Audio Element Persistent Across Pages
- what does the symbol “?” mean and how can i edit that page?
- Show children connected to parent pages
- How to get an array of pages ID by some page’s slug and all its children pages in get_posts() function?
- Restrict specific private page to a specific user
- How to remove a page in its entirety
- Display latest comments (global) with replies on a page
- Editing Pages Icons Are Not Showing Up – Why is this happening?
- Assign Parent Page – Now 404 Error
- Create multiple custom HTML pages
- WordPress displays widgets out of whack
- Add homepage to the list of pages in the Footer Widget
- How to remove the duplicate title tags and duplicate meta descriptions?
- WordPress form submit to custom page template does not work
- How do I locate a third party page represented as a slug in my WordPress website?
- Customise the_title in admin area
- Add pagination to search.php page
- How to turn post into pages and via versa?
- How do I get my page “About” to show up on my WordPress site?
- Featured Image not displaying in a page
- Pulling posts tagged with similar title name
- Filter posts by author selected in page
- Temporary download page or restrict static download page based on how the user got to the page?
- search page different results
- List Parent page with sub pages
- simple category search form returns full text – but I need excerpts
- Naming custom page templates
- Sort the data in WordPress using get-page-by-title
- Adding a filter to wp_edit_posts_query() to prevent hierarchical display of pages
- Order pages by date
- wordpress user profile page
- In WP, Google map error initMap is not a function [closed]
- WordPress is picking up links that don’t exist