hbrg
Forum Replies Created
-
Forum: Plugins
In reply to: [Lightweight Accordion] ::marker aligned to rightHere is an example. When you use display property other than ‘list-item’, ::marker will not be shown. We’ll use flexbox to align the content
.lightweight-accordion .lightweight-accordion-title {
display: flex;
justify-content: space-between;
align-items: center;}
Then it’s a matter of styling the custom marker that you want to show. Change ‘content’ value to whatever Unicode symbol you want to be a marker, or use background-image on ::after with width and height properties.
.lightweight-accordion .lightweight-accordion-title::after {
content: "\02C5";
color: #000;
font-size: 1.5rem;
margin-left: 2rem;
}Forum: Plugins
In reply to: [The Events Calendar] Alternate month view loaded with AJAXSure, though I can’t see the impact. You simply have two month views with different layout, I’d like to be able to choose the one that we get when picking the month from the datepicker. In the meantime, I’m simulating the click on datepicker and then the click on current month which in combination with some fadeIn on body works fine and gets the alternate view, but it’s a hack.
PHP: 8.0.1
WordPress: 6.4.1
The Events Calendar: 6.2.8.1, Minimal styling (though nothing changes with full styling applied)
Theme: custom theme built on top of Blankslate boilerplate theme.
URL: localhost site, in development.I use it in template file and call through function linked in the SO answer (https://stackoverflow.com/questions/55382244/get-reusable-block-in-php/76356149#76356149)
It’s because of applying “the_content” filter on that reusable block, like in the linked SO answer example. Without it everything looks normal. Now, you certainly know why is that, I don’t.
Forum: Plugins
In reply to: [Contextual Related Posts] Show related child pages of a parent pageYou might not need to use CRP for that. Try this and adapt as you like. This one will list parent page and then the child pages as list items <li></li>:
if (is_page()) { $page_id = get_queried_object_id(); $parent_id = wp_get_post_parent_id($page_id); $child_args = array( 'child_of' => $parent_id, 'title_li' => __(''), 'echo' => 0, ); if ($parent_id) { // this is a child page $child_pages = wp_list_pages($child_args); $parent_page = get_page($parent_id); echo '<li class="page_item_has_children current_page_ancestor current_page_parent page_item page-item-' . $parent_id . '"><a href="' . get_page_link($parent_page) . '" >' . $parent_page->post_title . '</a><li>'; } else { // this is a parent page, homepage or special page $child_args['child_of'] = $page_id; $child_pages = wp_list_pages($child_args); $parent_page = get_page($page_id); echo '<li class="page_item_has_children current_page_item page_item page-item-' . $page_id . '"><a href="' . get_page_link($parent_page) . '" >' . $parent_page->post_title . '</a><li>'; } echo $child_pages; }
Sorry for hijacking the thread, but I have a similar problem. CRP is including itself twice in the page: first in the page content, and after that when a custom function is used to display Guttenberg’s Reusable block. post_type is ‘wp_block’ and I can’t stop CRP from appearing in the Reusable block except using preg_replace on div with class “crp_related” which is an ugly hack.
To reproduce, create a Reusable block and echo it somewhere in the page template. CRP will appear twice: once in the page content and second time after the reusable block.
You can fetch the reusable block using something like this: https://stackoverflow.com/questions/55382244/get-reusable-block-in-php/76356149#76356149
I installed the 3.3.4-beta1 version, but no changes.
Forum: Fixing WordPress
In reply to: admin-ajax.php timeout after not visiting the site for a whileThank you. The profiler didn’t find anything out of the order. I guess I’m wondering if there is a log where it says what triggers admin-ajax call.
Forum: Fixing WordPress
In reply to: admin-ajax.php timeout after not visiting the site for a whileThank you for the reply. There are no caching plugins installed. Almost everything is disabled for testing, except a shipping plugin, Loco Translate, custom post type UI and page cloning for admin backend.
There are no performance issues – this admin-ajax timeout occurs only after not visiting the site for a few days. Memory limit is 256M. Is there a troubleshooting tool, a log or recommended steps to try to figure out why the timeout occurs? Like, what called admin-ajax at that point?
Site Health also lists:
“Page cache enhances the speed and performance of your site by saving and serving static pages instead of calling for a page every time a user visits.
Page cache is detected by looking for an active page cache plugin as well as making three requests to the homepage and looking for one or more of the following HTTP client caching response headers:
cache-control
,expires
,age
,last-modified
,etag
,x-cache-enabled
,x-cache-disabled
,x-srcache-store-status
,x-srcache-fetch-status.
- Median server response time was 639 milliseconds. It should be less than the recommended 600 milliseconds threshold.
- No client caching response headers were detected.
- ?A page cache plugin was not detected.”