Phi Phan
Forum Replies Created
-
Hi Hozefa @hozefasmile,
Thank you for your suggestion. I initially thought about allowing popovers to be triggered on mouseover as well as on click, but decided not include it to keep things simple. However, I will reconsider this feature and seek a solution. I will let you know when it’s available.
Best, Phi.
Forum: Plugins
In reply to: [Meta Field Block] different ACF date display formatHi @philbee,
I intended to add that setting to the block, but then I changed my mind. I want to keep the logic and UI of this block simple. Most of the rare cases can be handled easily with custom code. In your case, you can display different date formats between contexts by using conditional tags.
You can adjust the following sample code to display different formats for your field:
add_filter(
'meta_field_block_get_acf_field',
function ( $block_content, $post_id, $field, $raw_value, $object_type ) {
// Replaceyour_date_field
with your unique name.
if ( $block_content && 'your_date_field' === ( $field['name'] ?? '' ) ) {
// You can use conditional tags to determine the field context.
if ( is_single() ) {
// Change your date format here.
return date( 'm/d/Y', strtotime( $block_content ) );
} else {
// Change your date format here.
return date( 'd/m/Y', strtotime( $block_content ) );
}
}
return $block_content;
},
10,
5
);Best, Phi.
- This reply was modified 9 hours, 45 minutes ago by Phi Phan.
Forum: Plugins
In reply to: [SVG Block] Margin: No more negative values possibleHello Triopsi @triopsi,
The block does not support negative margins in the current version. I will consider adding this feature in a future version. For now, you can achieve that effect by placing the block inside a core/group block and applying a negative margin to the group block.
Best, Phi.
Forum: Plugins
In reply to: [Meta Field Block] This message was added in version 6.7.0.You’re welcome.
Forum: Plugins
In reply to: [Breadcrumb Block] Breadcrumb path for Post Archive Page@mdxfr You’re welcome. I’m glad to hear it works.
Phi.
Forum: Plugins
In reply to: [Meta Field Block] This message was added in version 6.7.0.@revelation75 I’ve just fixed it in the latest version 1.3.2.
Thank you again for reporting it.
Phi.
Forum: Plugins
In reply to: [Breadcrumb Block] Breadcrumb path for Post Archive Page@mdxfr Here is the code snippet for all single, category, post tag contexts:
// Prepend the blog page.
function breadcrumb_block_prepend_blog( $breadcrumbs_instance ) {
$blog_id = get_option( 'page_for_posts' );
if ( $blog_id ) {
$breadcrumbs_instance->add_item( get_the_title( $blog_id ), get_permalink( $blog_id ) );
}
}
// Single post context.
add_action(
'breadcrumb_block_single_prepend',
function ( $post, $breadcrumbs_instance ) {
if ( 'post' === $post->post_type ) {
breadcrumb_block_prepend_blog( $breadcrumbs_instance );
}
},
10,
2
);
// Category context.
add_filter(
'breadcrumb_block_get_item',
function ( $item, $context, $breadcrumbs_instance ) {
if ( ! $context || 'term' !== ( $context['type'] ?? '' ) ) {
return $item;
}
if ( 'category' === $context['object']->taxonomy && ! intval( $this_category->parent ) ) {
breadcrumb_block_prepend_blog( $breadcrumbs_instance );
}
return $item;
},
10,
3
);
// Post tag context.
add_filter(
'breadcrumb_block_get_item',
function ( $item, $context, $breadcrumbs_instance ) {
if ( ! $context || 'term' !== ( $context['type'] ?? '' ) ) {
return $item;
}
if ( 'post_tag' === $context['object']->taxonomy ) {
breadcrumb_block_prepend_blog( $breadcrumbs_instance );
}
return $item;
},
10,
3
);I’ve not tested it yet, please let me know if it works for you.
Phi.
Forum: Plugins
In reply to: [Breadcrumb Block] Breadcrumb path for Post Archive PageHello Marc @mdxfr,
Could you clarify what you mean by “an archive page for posts”? Also, is “My cat” a post tag or a category? Please provide more details.
Thanks, Phi
Forum: Plugins
In reply to: [Meta Field Block] This message was added in version 6.7.0.@revelation75 Thank you for reporting it. I will look into it soon.
Phi.
@mlr4948 Thank you! I really appreciate it.
Phi.
@mlr4948 You’re welcome! By the way, if you don’t mind and have the time, please give it a review and rating to help it grow.
Thank you! Have a nice day!
Phi.
@mlr4948 Ah, in my tests, the videos play well, however the controls is overlaid by the heading below, which is why they are inactive and do not respond. You should remove the
margin-top:-145px
in the.wp-block-heading
selector. That CSS rule will cause a lot of issues not just for YouTube videos. It has nothing to do with Windows or Mac.@spoofkz I tried running the video URL directly and get an error: “Playback on other websites has been disabled by the video owner”. This might be the issue. Here is the direct link that the block generated for your video https://www.youtube-nocookie.com/embed/GDMTRZioCao?autoplay=1&playsinline=1
Phi.
@mlr4948 I tested five times both on Chrome and Edge for Windows. They all worked well for me. However, the heading below the videos overlays the bottom part of the videos, you should fix it by removing the
margin-top:-145px
on the.wp-block-heading
selector.Hi @spoofkz,
Could you provide me with a page that has the issue? I don’t see any videos on the page you provided, and the videos on other pages work well.
Best, Phi