How to remove admin submenu item of WordPress Plugin? - php

I installed the following plug-in to provide testimonials for my WordPress site.
https://codecanyon.net/item/testimonials-showcase-wordpress-plugin/6588139
The plug-in somehow creates a submenu „Group“ with link „edit-tags.php&taxonomy=ttshowcase_groups&post_type=ttshowcase“ which I would like to get removed as there is no need for my case to have such groups.
So I reviewed the files on the plug-in’s directory but can’t find where the menu is created. It somehow looks to me it’s there by default or similar.
So I tried adding a function to the plugins main php file using „remove_submenu_page“, but that’s just crashing the whole site.
I would appreciate some help. Thanks.

add to your functions.php
remove_menu_page( 'edit-tags.php&taxonomy=ttshowcase_groups&post_type=ttshowcase' );

Related

How can i have a pagination on my wordpress website

I'm trying to have a pagination on my custom Products page that is not the default one in Woocommerce.
I used Elementor to customize this page and after some research I saw that I could call a function that is already integrated in WordPress using the < paginate_links > function.
The only problem is that I have no idea where to call this function in order to have a pagination on my product page.
To be more precise, i would like to know where exactly i have to change or add my php functions, and what code should i use to get my pagination.
Normally it is in the archive.php or a version of that file name specific to your post-type. But before you go and change it, create a child theme in case you haven't done that already. In the child theme folder, you then duplicate the archive.php or similar to make it overwrite the one from the parent theme. This way you keep your version of the theme clean and updatable without losing any changes.
(For creating a child-theme you will need to create at least a style.css [with a WordPress-specific comment, you can google] and a functions.php-file that needs a bit of php-code to enqueue the child-themes scripts and styles. The code for the functions.php can also be found by a quick google search. You then just place the style.css and the functions.php into a new folder you name in the pattern [foldername of your themes name]-child. You then place this folder next to the parent-themes folder in the "/wp-content/themes/"-directory.)
And here you go for the pagination: https://codex.wordpress.org/Pagination

Update permalinks wordpress via PHP

Ive just created a new custom post type on the wordpress website of a client. However the original author of the template disabled the 'settings' menu in the Wordpress Dashboard, so I cant update the permalinks through the dashboard. I can't seem to find the location where he could've disabled it, so im now looking for alternatives.
1) I downloaded a lot of the server to find the "remove_menu_page( 'options-general.php' );" line of code, but as said i cant find it.
2) I've heard of the flush_rewrite_rules(); functions but im a bit sceptical to use it as I'm not 100% sure what it does and dont want to screw up existing pages on their website.
Any insight or advice on any of the two topics?
Use it like this in you functions.php and run the website once, then you're free to remove it.
function custom_rewrite_rules(){
flush_rewrite_rules();
}
add_action('init', 'custom_rewrite_rules' );

Default text appears on wordpress

Actually i'm working on a wordpress website, which is related to school, i'm using universh WP theme which is purchased. I'm getting the below text as default:
Want create site? Find Free WordPress Themes and plugins.
See, i've marked those words. Actually its a dynamic page, i've checked the core code. It's only the
the_excerpt()
function. After that i don't have any idea, where it comes from. Also i've read this thread So please don't recommend that thread, its not working i've tried the way there mentioned.
P.S. Also the text will disappears when I login and try to edit the page.
What text editor You use ? Most easy way will be open folder with theme in some editor and search this string "Want create site? Find Free WordPress Themes and plugins." in all files - then You will know where they add it ... or You can check every file, because this string must be included somewhere, maybe in function.php they add some modification to the_excerpt();
I think when you ass content in post default editor then is not showing in the_expert() function
So you can add content in expert editor then after call the_expert() funtion
Check that your theme is not using the get_the_excerpt filter to prepend that phrase to all the excerpts.
Additional, if you only checked the files that load for that specific template, I would recommend that you run a search for that string for the entire theme. The source of the issue might stem from functions.php or even some JavaScript file.
Please update the core files or update version of your WordPress. Use Latest one.

Wordpress - creating custom pages with php code

I need to add few additional pages to my wordpress site.
These pages should not be "part of the site", ie they should not be linked somewhere from the posts and so on.
However, they should have the same header/footer as the rest of the site ( I am using custom theme ). And they should be accessible via url.
The final requirement is, I should be able to code in php.
At the moment, I tried to create a new "Page" in my admin console. And then write some php-code inside. However, all my php code gets commented and since not executed.
I don't think that installing plugins such as Exec-PHP is a good idea, so I am trying to find other solutions.
Any comments/advice/suggestions how to make it?
I would be grateful if you give me some how-to link.
Thank you in advance.
You can use a custom page template in your theme for this and just keep the site empty in the admin panel:
http://codex.wordpress.org/Theme_Development#Custom_Page_Templates
By using Template tag's you can create custom page.
write this code on the top of your php file....
/*
Template Name: Your Template Name
*/

Breadcrumbs in Fishpig Magento/Wordpress

I have a Fishpig/Wordpress installation on my magento site. All works nicely apart from when I look at a child category page. For example if you visit:
http://www.kitronik.co.uk/blog/resources/
then click on a category eg E-Textiles:
http://www.kitronik.co.uk/blog/resources/e-textiles-tutorials-resources/
You see that there are no longer breadcrumbs. I can't see why there wouldn't be any for this page?
From looking at your site I can see that you have something custom going on with your breadcrumbs. On the Resources category, by default, the Magento WordPress Integration extension would insert a 'Blog' breadcrumb between the home page and Resources breadcrumb items.
As for the sub-category, the breadcrumbs are pretty much missing completely (other than the home item).
My recommendation would be to check your page/html/breadcrumbs.phtml. If this file is present in your custom theme, trying renaming it to breadcrumbs.phtml.old. This will allow the original breadcrumbs.phtml file to be used from base/default. If this resolves your problem, you know that custom code in your breadcrumbs.phtml was the problem.
Alternatively, do you have a Magento SEO extension installed that modifies your breadcrumbs? If so, you could try disabling this temporarily and seeing whether this resolves the problem.

Categories