Matt Schofield
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Astra] Live Search feature requestMarked as resolved. Thanks
Forum: Themes and Templates
In reply to: [Astra] Live Search feature requestI got it. I was over complicating things. I’ve managed to exclude specific pages and posts by their post ID from Live Search Results using the following php snippet:
/**
* Exclude specific post IDs from WordPress search results.
*/
function exclude_posts_pages_from_search( $query ) {
if ( $query->is_search() && ! is_admin() ) { // Check if it's a front-end search.
$excluded_post_ids = array( 245, 3860, 3864, 3862, 7930, 9943 ); // Replace with your post/page IDs.
if ( ! empty( $excluded_post_ids ) ) {
$query->set( 'post__not_in', $excluded_post_ids );
}
}
return $query;
}
add_filter( 'pre_get_posts', 'exclude_posts_pages_from_search' );Please consider providing this granular control for Live Search Results in Astra. Thanks again for looking.
Forum: Themes and Templates
In reply to: [Astra] Live Search feature requestHi @bsfaradhy
Thanks for the reply. However, that’s not what I meant. It would be very useful to be able to exclude specific posts ID’s from the live search results.
I’ve been trying to find the filter Astra uses for its live search AJAX requests, so I could write my own snippet for specific post ID exclusion, but I’m struggling to understand how Astra is handling it.
Great job, thanks. Marking as resolved
Courtesy update.
Our Astra Theme (and Astra Pro plugin) received the 4.8.0 update this morning (changelog). I tested disabling the smooth scroll code snippet provided above and found the SimpleToc smooth scroll is fully functional again without the snippet. Smooth scrolling to headings within group blocks is no longer a problem.
I added the following code snippet to our site to patch the issue for now. Headings within group blocks are now reliably smooth-scrolled to when clicked from the Simpletoc table of contents.
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.simpletoc-list a').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
const targetId = this.getAttribute('href').split('#')[1];
const targetElement = document.getElementById(targetId);
if (targetElement) {
const rect = targetElement.getBoundingClientRect();
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
const targetOffsetTop = rect.top + scrollTop;
window.scrollTo({
top: targetOffsetTop,
behavior: 'smooth'
});
}
});
});
});Another follow up observation.
If you select the group block in the editor, and in the settings pane disable the Layout toggle “Inner blocks use content width”, and save the page, the SimpleToc menu functions properly on the frontend and the default (or edited if required) padding of the group block is respected. In short, the page content is stylistically as intended with padding, and the Simpletoc menu works properly by scrolling to the heading within said group block.
Some hopefully useful documentation of the WP Core 6.6.x padding changes here and here.
As a follow up observation…
If you select the Group block in the editor, and go to Style > Dimensions, and then add a custom “0” value to both the padding Top and Bottom and padding Left and Right properties, the scroll to the heading within that Group block from the SimpleTOC menu functions properly.
Forum: Plugins
In reply to: [Schema & Structured Data for WP & AMP] Course info Schema – fields requestThat’s right. Everything you need is there.
In your screenshot, the fields you need to complete to make the schema course markup valid for ‘HasCourseInstance’ and ‘Offers’ are…
- Offer Category (eg. Paid)
- CourseMode (Online or Onsite)
- Offer Price (just numbers eg 150.00)
- Offer Price Currency (GBP)
Obviously provide as much info in all the relevant sections as you can, but those listed above are the ones you’ll need at minimum for Google to verify your markup as valid for hascourseinstance and offers.
Forum: Themes and Templates
In reply to: [Astra] 4.6.8 causes cache issues with WP RocketPlease note this was reported as an Astra problem, but was in fact not an Astra problem. It just looked and tested like one. It was in fact a me problem. Resolved.
Can confirm this is now fixed and working as expected in update 4.6.8. Thanks
Also experiencing the same problem. The blog Single Post .entry-title isn’t respecting the values for either desktop, tablet or mobile that are entered into the customizer (Blog > Single > Post Title Area > Design > Title Font). Instead some .entry-title class is setting “1.6em” value by default to all screen widths. Mine are all single post with sidebar. I don’t have any without sidebar to test.
Forum: Plugins
In reply to: [Schema & Structured Data for WP & AMP] Course info Schema – fields requestI’m not sure if we’ve got crossed wires? The problem is that Google now wishes to see the fields ‘hasCourseInstance’ and ‘Offers’ in Course markup. If those fields are absent, they’re evaluating the markup as Invalid. Or are you saying the Pro version has those fields?
Forum: Plugins
In reply to: [Schema & Structured Data for WP & AMP] Course info Schema – fields requestSure.
We’re using only your plugin to manage all the site schema markup.
We have added Schema Type “Course” with a Placement of “Post Category” “Equal to”… (and then the appropriate category).
In Gutenberg editor on each of our Course pages, we scroll down to the Schema a Structured Data panel, select the “Course — Category…” and then manually enter the values into the provided fields. It is within there that we ideally require the ‘hasCourseInstance’ and ‘Offers’ fields, so we can satisfy what Google are looking for.
Thanks again for looking at this.
Forum: Plugins
In reply to: [Schema & Structured Data for WP & AMP] Course info Schema – fields requestSure. Here’s one