Is it possible to add wordpress plugin in a page-template? - php

I have created a theme using a Bootstrap template.Now I want add a wordpress plugin in the created theme. I have tried to add a plugin in the theme the plugin is installed in WordPress but it is not making any changes to the webpage?
Is there any query has to be included in functions.php file?

Copy plugin file to your theme directory then include its main file. If your plugin folder name is custom-plugin and main file of that plugin is custom-plugin.php then include that in your functions.php like that
include_once( get_stylesheet_directory().'/custom-plugin/custom-plugin.php');

Related

How can I edit wordpress theme core file as a child theme

I recently have a wordpress project for a friend, I'm building the blog on a wordpress theme called MagazineNP parent theme.
I've been actually trying to remove it's footer credits but I could edit it from the parent theme succefully, when i try editing it as a child theme, the changes do not reflect on the site.
I later discovered that core file are not easily edited cause this file I'm editing is found in the theme's core folder.
I'll appreciate any help on how to do this in my child theme i.e editing the core file adding it to my child theme so it wont be overiden when updated.

override wedevs-dokan-plugin template file from theme wordpress

I'm using the wedevs-dokan-plugin (wedevs.com/dokan) for a WordPress frontend user store, which allows sellers to manage their store from the frontend.
I want to override one of the template files of this plugin. The file which I want to override is located at:
plugins/wedevs-dokan-plugin/templates/product-edit.php
And to override this file, I copied the file and made some changes, putting this new file in the theme directory like this:
themes/mytheme/wedevs-dokan-plugin/product-edit.php
But this isn't working for me. After that I also tried:
themes/mytheme/wedevs-dokan-plugin/templates/product-edit.php
But that's also not working.
Is there any way to override the plugin files from within a WordPress theme?
themes/mytheme/wedevs-dokan-plugin/product-edit.php
Instead of "wedevs-dokan-plugin" the directory name should be "dokan" and you can only edit the "templates" directory files of this plugin.
So, the new directory will look like these.
themes/mytheme/dokan/store.php
themes/mytheme/dokan/dashboard/dashboard.php
Thanks

WooCommerce: Can't find woocommerce/templates/ directory

I am trying to set up a shop for my site using WooCommerce. My goal is removing the "Product Categories" (and maybe "Search" box) on product archive/shop base page. I know editing the "product-archive.php" file is required. But I just can't find it! It should be somewhere in woocommerce/templates/ directory, but there's no such directory!
I'm using Fruitful theme by Fruitfulcode. I'm using the latest versions of WordPress and WooCommerce. I tried virtually anything: installing and reinstalling WooCommerce, installing an older version of WooCommerce... Nothing works. There's no woocommerce/templates directory anywhere in my theme!
Could you please assist me? Am I doing something wrong?
I think you're a bit confused about how WooCommerce template overrides work. Here's some important info you should be aware of:
Installing WooCommerce won't modify your theme at all.
You shouldn't have a woocommerce/templates/ directory in your theme, even if the theme is overriding default WooCommerce templates. Rather, you may have a woocommerce/ directory (without the templates/ directory).
WooCommerce templates are overridden by copying template files from /wp-content/plugins/woocommerce/templates/xxx.php to wp-content/themes/yourtheme/woocommerce/xxx.php
If you aren't seeing a woocommerce directory in your theme, that means that your theme is using the default WooCommerce templates. If you would like to override them, you need to copy the product-archive.php template from the WooCommerce plugin templates directory into a woocommerce/ directory within your theme.
More info in the WooCommerce documentation.
Reading your answer twice I think you may be speaking of widgets since you mention categories and search box. This is usually in the sidebar. You don't need to edit woocommerce template files to change this.
Look for the widget that is being displayed on the archive pages and remove the ones you don't need.
Go to Appearance/widgets and look for the sidebar that is being displayed on the shop and delete the unwanted elements.
You could also use the customizer to view it visually while doing it.
Hope this helps
Im sorry if this doesn't help answer your question but the file you're looking for is archive-product.php not product-archive.php, this is the second question I've seen with this non-existent file mentioned.
If a child theme is being used, the absolute path to the parent theme directory will be returned. Use get_stylesheet_directory() to get the absolute path to the child theme directory.
You need to use get_stylesheet_directory_uri() instead of get_template_directory() in your child theme.
echo get_template_directory()
/*Retrieve theme directory URI.*/
get_template_directory_uri()
require get_theme_file_path( 'inc/post-types.php' );
By default, there won't be any woocommerce fil s inside your theme folder. If you want to customize the Woocommerce tempalte files, you need to copy the files which you want to edit from TEMPLATES folder inside the Woocommerce plugin folder and paste inside your theme folder under folder name called WOOCOMMERCE.

Wordpress - How can I edit the header of a template?

I am new in the using Wordpress. I downloaded this theme and because my title of the website is too long, I need to change the header of this theme.
So I went into
wp-content/themes/Gordon/header.php
I tried to update this file, but the changes I made didn't appear on the page. So I delete the entire content of this file (blank file), and when I reloaded the homepage - again - nothing has changed, no error, just nothing.
So I would like to ask you, how can I update the header of an installed theme in Wordpress.
You messed up your header.php, best way to solve it is to open the header.php from the original theme (download) and copy/paste the code to your header.php that's online, using FTP.
Create a Child theme using One-click child theme plugin, copy the header.php into this child theme using an FTP connection again.
Then make your edits here or add a style.css to edit the header using css.
Useful links
http://codex.wordpress.org/Child_Themes
http://wordpress.org/extend/plugins/one-click-child-theme/
http://codex.wordpress.org/Designing_Headers

Where do I find a custom function in a wordpress theme?

Where can i find the function "premiumpress_header_inside" in Coupons Wordpress theme?
I would like to make some change in this function.
DO you any body know that in which PHP file it is located?
All theme functions are stored in the file called functions.php inside the theme's folder.
Navigate to wp-content/themes in your wordpress installation, open the folder for 'Coupons' and then open the functions.php file.
You will then be able to search for the function 'premiumpress_header_inside' and make modifications.

Categories