identity
Forum Replies Created
-
AuthorPosts
-
Thanks Paolo, understand.
Cheers
Naveen, thank.
Actually I tried using that example to modify address (initial post at top of thread), but wasn’t able to. It this point I think it might be easier to just fork over to a custom theme and then manually update as need be.
Cheers
Let me ask a secondary question also…
With the thought of forking to my own theme and then doing a manual diff-merge of Starter and Supreme and carefully porting over edits, how often would those themes likely be updated?
I know that is unknown, but some kind of guess based on history would be useful. I realize that there core and addons may get updated quite a few times throughout the year, but was thinking the themes may be a bit more stable…?
Cheers
Thanks guys.
Any examples or details on using hooks to modify?
Cheers
You’re right, though I wish there was more of an option for that as those pages really diverge from the overall look of the rest of the site, even more so as it drops the footer as well.
Hopefully at least the location images can be restored though.
It would also be nice if the detail page had that functionality as well, when an image isn’t uploaded, to at least display a CPT/Category/Subcategory default image.
Thanks as always (FYI, at some point here, I might be reaching out to you for some custom design/development work).
Cheers
Thanks Guust,
What I actually want is to have more granular images, not just change the site wide image.
So default/fallback images for CPT, category, and location pages.
Cheers
Right, just thought it was worth seeing if anyone had “worked” something like this out.
Thanks
Thanks.
I may revisit Supreme then, which was the direction I was going down before and then I became enamored with the look of Listimia.
But perhaps I can pull in or come up with a similar visual in Supreme and keep everything tighter to the code.
Cheers
No, that doesn’t seem to work either.
That would be nice for testing, but at least this other code works now and the timing can be adjusted to a smaller delay for testing.
Just to confirm and as I further edited the code for coding consistency and have tested and it appears to be working, this is the code that I am using now for randomization every 5 minutes.
add_filter('geodir_rand_seed','_my_geodir_rand_seed'); function _my_geodir_rand_seed($rand_seed) { $rand_seed = get_transient('geodir_rand_seed_custom'); // if we don't have a transient then set a new one if (!$rand_seed) { $rand_seed = time(); set_transient('geodir_rand_seed_custom', $rand_seed, 5 * MINUTE_IN_SECONDS); } // validate $rand_seed = absint($rand_seed); return $rand_seed; }
Which I have set to run in the Snippets plugin, set to Run Snippet Everywhere, though I imagine this could be set to just run on the Front-end.
Cheers
Naveen,
Thanks.
I think the coding example here:
https://wpgeodirectory.com/docs-v2/places/sorting/
may have some errors in it.I noticed some differences in your code, beyond the MINUTE_IN_SECONDS vs the HOUR_IN_SECONDS that I was using from that page.
My code, taken from https://wpgeodirectory.com/docs-v2/places/sorting/
add_filter('geodir_rand_seed','_my_geodir_rand_seed'); function _my_geodir_rand_seed($rand_seed){ $rand_seed = get_transient( 'geodir_rand_seed_custom' ); // if we don't have a transient then set a new one if(!$rand_seed){ $rand_seed = time(); set_transient( 'geodir_rand_seed_custom', $rand_seed, .05 * HOUR_IN_SECONDS ); } // validate $rand_seed = absint($rand_seed); return $rand_seed; }
VS your code:
add_filter('geodir_rand_seed','_my_geodir_rand_seed'); function _my_geodir_rand_seed($rand_seed) { $rand_seed = get_transient( 'geodir_rand_seed_custom' ); // if we don't have a transient then set a new one if ( ! $rand_seed ) { $rand_seed = time(); set_transient( 'geodir_rand_seed_custom', $rand_seed, 5 * MINUTE_IN_SECONDS ); } // validate $rand_seed = absint( $rand_seed ); return $rand_seed; }
Notice some differences between the two, especially in line 2 and line 6. Some of this may not matter, but I noticed that after adding a space in line two in my code between:
) {
That my code appears to work now also.If that is the case, it would be helpful if someone could update the code example in the GD docs.
I still haven’t been able to get the other “randomize on refresh” code to work:
add_filter('geodir_rand_seed','__return_zero'); // Upon refresh
Cheers
Excellent!
Cheers
Naveen,
Great, thanks!
I don’t know whether any other issues were created in this swap, but the specific issue of Image/Icon selection within the category edit page seems to be working now.
Cheers!
Using the recommended Snippets plugin, I tried individually, the following code set to run everywhere.
First:
add_filter('geodir_rand_seed','_my_geodir_rand_seed'); function _my_geodir_rand_seed($rand_seed){ $rand_seed = get_transient( 'geodir_rand_seed_custom' ); // if we don't have a transient then set a new one if(!$rand_seed){ $rand_seed = time(); set_transient( 'geodir_rand_seed_custom', $rand_seed, .05 * HOUR_IN_SECONDS ); } // validate $rand_seed = absint($rand_seed); return $rand_seed; }
Then:
add_filter('geodir_rand_seed','__return_zero'); // Upon refresh
No sign of re-ordering even nearly 2 hours since I changed to the “Upon refresh” version.
Thanks
Unfortunately, not sure this is working.
Trying both a ~3 minute limit as well as the “every refresh” version against the “tiered-featured” sort I was experimenting (from our other thread https://wpgeodirectory.com/support/topic/setting-up-two-levels-of-featured/#post-516997), but kept getting the same results.
To validate that something else wasn’t influencing the results with that other test, I tried refreshing multiple times against a purely “random” sort with not sub-sorting or other treatment and I continue to get the results in the same order.
Cheers
Excellent, that helps!
Cheers
-
AuthorPosts