Brendan Shanahan
Forum Replies Created
-
Forum: Plugins
In reply to: [Comments - wpDiscuz] WPDisuz – Calculate total comment ratingUpdate – I found the rating field names are prefixed with ‘wpdiscuz_post_rating_’ so I was able to create myself a shortcode using my 3 rating blocks of Range, Performance & Quality.
Code below for future reference.
// WPDISCUZ - Create average total rating
function calculate_average_rating($post_id) {
// Get the values of the custom fields as decimals
$range = get_post_meta($post_id, 'wpdiscuz_post_rating_custom_field_66daac035fb55', true);
$performance = get_post_meta($post_id, 'wpdiscuz_post_rating_custom_field_66daabe060bd9', true);
$quality = get_post_meta($post_id, 'wpdiscuz_post_rating_custom_field_66daabbb7b585', true);
// Convert the values to float (to ensure decimal handling)
$range = floatval($range);
$performance = floatval($performance);
$quality = floatval($quality);
// Calculate the average
$total_fields = 3;
$sum = $range + $performance + $quality;
$average = $sum / $total_fields;
return $average;
}
// Function to return the average rating for the current post
function display_average_rating() {
global $post;
// Get the average rating for the current post
$average_rating = calculate_average_rating($post->ID);
// Return the average rating to display in the post content, formatted to 2 decimal places
return 'Average Rating: ' . number_format($average_rating, 2); // Keep 2 decimal places
}
// Register the shortcode [average_rating]
add_shortcode('average_rating', 'display_average_rating');- This reply was modified 2 months, 1 week ago by Brendan Shanahan.
Forum: Plugins
In reply to: [Comments - wpDiscuz] WPDisuz – Calculate total comment ratingAre the rating values available via REST API so that I could build my own total/average rating attribue? If not via API, is there another method you could suggest that I investigate?
Thanks,
Brendan
Forum: Plugins
In reply to: [Post My CF7 Form] Select options are not showingThank you! I was pulling my hair out until I found this thread and realised a different shortcode is required!
Forum: Plugins
In reply to: [Spectra - WordPress Gutenberg Blocks] Post Carousel IssuesFor reference, this issue was resolved with a setting change in GeneratePress:
The thread with the solution is here:
https://generatepress.com/forums/topic/issue-with-ultimate-addons-for-gutenberg/And the relevant post is:
So those Elements are using a width: 100% + padding. The developers should really including a
box-sizing: border-box;
property to stop that from happening.However, simple fix is to go to Customizer > General and switch the Structure from Floats to Flex.
Forum: Plugins
In reply to: [Spectra - WordPress Gutenberg Blocks] Post Carousel IssuesThank you, I have now raised a ticket.
Forum: Plugins
In reply to: [Spectra - WordPress Gutenberg Blocks] Post Carousel IssuesHi Sweta,
I have done some additional testing on a staging site. I was able to confirm that the issue is not caused by any of my plugins, but that it does go away when I change my theme. My theme is Generatepress.
I then tried rolling back my theme through various versions, but I was never able to find a version without the issue which made me suspect it was not caused by a change in the theme.
So then I started rolling back UAG through various versions, and I can confirm that these bugs started in UAG 1.20.0, in version 1.19.0 and earlier the post carousel works normally with the Generatepress theme.
- This reply was modified 3 years, 7 months ago by Brendan Shanahan.
Forum: Plugins
In reply to: [Spectra - WordPress Gutenberg Blocks] Post Carousel IssuesHi Sweta,
Thank you for your reply. For issue 1, the carousel loads ok in edit mode, but the issue appears when viewing the published page.
For issue 2, I have created a video:
Carousel endless expandingThanks @angelo_nwl. Is there a development queue or ticket that I can follow?
Bulk editing functionality would definitely entice me to convert to Pro.
Thanks. I have chosen to keep the post type enabled and hide the event categories as much as possible as I don’t need them anyway due to a Buddypress group integration. The limitations of disabling the SEO customisation of all events outweighed this page title issue.
I am sure there are other workarounds I could investigate, such as disabling the event categories formats option, but it is not a high enough priority for me at the moment.
Thanks @cybr.
As the event categories are not prominent I need to do some testing to understand the impact of this before committing to excluding events from TSF. I have tested disabling events post type in TSF and I can confirm that it did fix the event category page title.
Removing the post type will also remove them from my sitemap, so I will need to disable TSF sitemap and jetpack or some other plugin to close this gap also.
Cheers,
BrendanNope, example at https://sofacheer.com/events/categories/nrl/nrl-2020/
Forum: Plugins
In reply to: [BuddyMeet] No user or avatar for shortcodeThanks,
Sorry, I assumed that buddymeet would be default use the users avatar and username from WordPress when using the shortcode, the same way it does for group enabled buddymeet rooms.
I will do some digging to see how I can get the user’s name and avatar link values into a shortcode.
Forum: Plugins
In reply to: [BuddyMeet] Shortcode not working on Learndash lessonsFollowing this as I have the same issue with the lock error (I am not using learndash).
I have also commented out these lines in buddypress.php to resolve this.
Forum: Plugins
In reply to: [Spectra - WordPress Gutenberg Blocks] Table of Contents no backgroundThank you Vrunda
Thanks @markwt, tested and confirmed the issue persists after deactivating/reactivating either Geo Mashup or GDPR Cookie Consent.
I will follow up with the support contact.