problems with GD home popular categories widget
This topic contains 10 replies, has 3 voices, and was last updated by Giri 8 years, 10 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
December 18, 2016 at 2:20 pm #326557
Hi,
I got two problems.
a) refer attached file , indicated with arrow , how to remove categories words from the selection.
It is showing for all categories , make the text longer , not making any senses and annoying users.2) Only want to show some primary categories here. Do not want to show other categories.
Refer picture , do not want to show the categories in the blue line . How to exclude them showing here ?
Rgds,
YCDecember 18, 2016 at 10:16 pm #326712You can remove “Categories” in the GD core language file.
Look for%s Categoriesand change to
%sThere is no option to customize what CPTs are listed there, except deleting them.
December 19, 2016 at 1:13 am #326787Hi,
I only want to remove from home page drop down list.
Will your suggestion remove categorizes keywords from the entire directory website or only home page widget drop down list ?Rgds,
YCDecember 19, 2016 at 5:05 am #326904My suggestion will remove “categories” from all CPT drop down lists in every instance of the GD Popular Categories widget.
December 19, 2016 at 10:29 am #326971HI,
Okay with 1st question.
For the 2nd below question , why can’t I exclude in the drop down list ? I even can exclude any CPT from Map categories . There is option to exclude from Map for each CPT. Why there is no option from categories widget drop down list ?
2) Only want to show some primary categories here. Do not want to show other categories.
Refer picture , do not want to show the categories in the blue line . How to exclude them showing here ?Rgds,
December 19, 2016 at 11:38 am #326993Hi Ding,
I have added a filter in GD core to modify the output of that dropdown. It will be avilable in next release.
In the meantime follow these steps
You need to add this line
$taxonomy = apply_filters('geodir_pp_category_taxonomy', $taxonomy);in
wp-content/plugins/geodirectory/geodirectory-functions/general_functions.phpAround line number 2770
AFTER this code
$taxonomy = array(); if ( ! empty( $gd_post_type ) ) { $taxonomy[] = $gd_post_type . "category"; } else { $taxonomy = geodir_get_taxonomies( $gd_post_type ); }Once you are done with that edit your child theme functions.php file and then add this code
function exclude_gd_taxonomies($taxonomies) { $excluded_post_types = array('gd_place', 'gd_job'); foreach ($excluded_post_types as $ptype) { $cat = $ptype . "category"; if(($key = array_search($cat, $taxonomies)) !== false) { unset($taxonomies[$key]); } } return $taxonomies; } add_filter('geodir_pp_category_taxonomy', 'exclude_gd_taxonomies');You can also provide me admin credentials. So I can apply them.
Thanks
December 20, 2016 at 5:18 am #327458Hi Giri,
Thanks.
I am using main theme Geo Directory Starter Theme.
I don’t have child theme.
I just need to modify Directory Starter Theme theme functions.php , right ?After adding this , where can I configure exclude CPT categories list ?
Rgds,
YCDecember 20, 2016 at 9:14 am #327493Hi Ding,
Please use code snippets plugin to add custom codes.
https://wordpress.org/plugins/code-snippets/
Just add the post types in this array.
$excluded_post_types = array('gd_place', 'gd_job');I have used gd_place and gd_job as an example.
You can get the post type names in this page.
wp-admin/admin.php?page=geodirectory&tab=geodir_manage_custom_postsThanks
December 21, 2016 at 8:15 am #328196Hi Giri,
Thanks a lot.
It works.Rgds,
YCDecember 21, 2016 at 8:16 am #328197Pls include this in next release. Thanks.
December 21, 2016 at 8:38 am #328198You are welcome.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket