Lost gd-post-pkg-x
This topic contains 19 replies, has 3 voices, and was last updated by Alex Rollin 7 years ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
February 14, 2018 at 2:08 am #417484
I’ve looked everywhere, (custom WPGD plugin, child-theme functions, etc…) but I can’t figure out why I’ve lost the “gd-post-pkg-x” from the <li class=”clearfix geodir-gridview gridview_onefourth gd-post-pkg-1 gd-post-gd_place” data-post-id=”131927″>.
I have the production site and the staging site. It IS showing on the production site, but NOT on the staging site. They have the same WPGD settings, the same packages, the same WPGD plugins, the same WPGD custom plugin file, same plugins active on those pages… I ran all the checks in Tools. I even went through every page tab in WPGD settings to see if there was something out of place there.
The only difference is that the production site has Kleo, and the staging site has Avada. But I have another test site where I reactivated the Kleo child theme, and it is also missing that code.
Any guidance?
Thanks.
February 14, 2018 at 10:15 am #417532Hello,
you might check to see if you got your snippets moved over, too. Is this the snippet you used?
https://wpgeodirectory.com/docs/common-code-snippets/#package
Let us know how it goes
February 14, 2018 at 3:37 pm #417585Hey Alex,
Yeah, I checked, and that code IS still in the WPGD custom plugin.
I also *added* it to the theme functions.php file directly. Now here’s something interesting. I left it active in the custom plugin as well, and it crashed the site (as expected *if* two of the same code is active). So the site IS seeing it.
I then removed it from the custom plugin, just leaving it in the theme directly, and the site came back (as expected) BUT the code was still not applying.
It’s strange. What should I try next?
Thanks.
February 14, 2018 at 8:50 pm #417650We can take a look if you like, just send over the URL and WP Admin.
Yes, good not to run it twice. The snippet doesn’t seem like it would react with Avada. I will flag your question as maybe the developers have an idea
February 14, 2018 at 8:57 pm #417654This reply has been marked as private.February 15, 2018 at 11:31 am #417739i guess the $post value is being reset at some point, you might need to get the package value independently like:
$package_id = geodir_get_post_meta($post->ID, 'package_id', true);
Stiofan
February 15, 2018 at 4:42 pm #417795This reply has been marked as private.February 15, 2018 at 6:31 pm #417801add_filter( 'body_class', 'my_add_package_class',10,1 ); function my_add_package_class($class){ global $post; $package_id = isset($post->package_id) ? $post->package_id :geodir_get_post_meta($post->ID, 'package_id', true); if (geodir_is_page('detail') && isset($package_id)) { $class[] = "gd-package-id-".$package_id; } return $class; }
Stiofan 🙂
February 15, 2018 at 7:10 pm #417803Thank you very much for the code mods. I hate to say it, but it did not resolve the issue.
In working on it more, I do see something that might be related. Last year, I was given some code to add a grouping of “Featured” listings above the main listings. It looks as though the Featured grouping DOES have the pkg-id, but the main listings do NOT. Here is the code for that and the new:
add_action('geodir_before_listing','_my_listings_top'); function _my_listings_top(){ global $wp_query; $current_term = $wp_query->get_queried_object(); $cat_id = isset($current_term->term_id) ? $current_term->term_id :''; $post_type = geodir_get_current_posttype() ? geodir_get_current_posttype() : 'gd_place'; $output = do_shortcode('[gd_listings post_type="'.$post_type.'" layout="4" character_count="140" category="'.$cat_id.'" post_number="10" list_sort="az" show_featured_only="1"]'); if (strpos($output, 'no-listing') === false) { echo "<h3>Featured GoLocal Listings</h3>"; echo $output; echo "<hr /><h3>More GoLocal Listings</h3><br />"; } } // add the package id to the body add_filter( 'body_class', 'my_add_package_class',10,1 ); function my_add_package_class($class){ global $post; $package_id = isset($post->package_id) ? $post->package_id :geodir_get_post_meta($post->ID, 'package_id', true); if (geodir_is_page('detail') && isset($package_id)) { $class[] = "gd-package-id-".$package_id; } return $class; }
Is it possible the ‘Featured’ code I was given now conflicts with the ability to pull package id in the rest of the listings?
Thanks.
February 16, 2018 at 10:27 am #417900No it does not look like it would affect it.
I do see that it is set to only run on the details page which i assume is wrong, i think u want it on the listings page
geodir_is_page('detail')
should be
geodir_is_page('listing')
Stiofan
February 16, 2018 at 6:38 pm #417951Still at this. I’ve tried a dozen different variations of theme functions and file tweaks, but I still have it only partially working. Have same themes now and same plugin stack. Plus I have exactly replicated code in the WPGD custom plugin of the two sites. Have got it to *partially* work. Here’s where I’m at:
The site that is working (showing the pkg-id) has the ‘sort’ and ‘view’ boxes separate; where the site that is not working has them together (but on the lower portion).
(see screencaps)Also in looking at dev tools, both sites have the pkg-id working on the top (Featured) but the broken site has some ‘geo-tax-sort’ class and then the listings below that do not work (for pkg-id).
(see screencaps).The WPGD Place Settings are the same (for sort, etc).
Maybe the screencaps will have something jump out.
Thanks for any direction to resolve.
February 19, 2018 at 10:07 am #418217Where is your code snippet? Can u link direct to it?
Stiofan
February 19, 2018 at 6:04 pm #418264The code snippet is part of a custom plugin where I compile all my WPGD related custom code. It is simply another plugin on the site: “GeoDirectory custom CCL.” You can see it in the admin > plugins.
The interesting part is that I have the exact code in the WPGD custom plugin on both sites.
I will also drop FTP creds in the next message so you can see it there.
Thanks.
February 19, 2018 at 6:10 pm #418267This reply has been marked as private.February 19, 2018 at 6:13 pm #418271This reply has been marked as private. -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket