xarz
Forum Replies Created
-
Same here:
Failed opening required ‘/public_html/wp-content/plugins/ajax-filter-posts/inc/functions.php’ (include_path=’.:/opt/remi/php74/root/usr/share/pear:/opt/remi/php74/root/usr/share/php:/usr/share/pear:/usr/share/php’) in /public_html/wp-content/plugins/ajax-filter-posts/ajax-filter-posts.php on line 94, referer: https://www.google.comForum: Plugins
In reply to: [Getwid - Gutenberg Blocks] Showing custom taxonomy name (again)This has been solved inserting a new block by code in functions.php of a custom taxonomy and then adding this field in the template editing under Display Options of the block Custom Post Type.
Forum: Plugins
In reply to: [Getwid - Gutenberg Blocks] Showing custom taxonomy name (again)You can see the problem in: https://dev3.netnerd.cat/sobre-cwp-2/
I found the field in wp_options. I was able to delete the malformed div.
But be aware that this could happen easily in the input message form.
It works only with the menu labeled primary menu in all pages but one. In one page I’ve a secondary menu acting as primary and the breakpoint starts at 600px not 1025 at expected and I don’t know why.
Solved!!!
There was a typo (a space) on my folder name. Sorry to bother you all.
I’ll start another thread because is another matter.
Solved, but I cannot make the entry-loop-taxonomies.php override work in my “yourtheme/kadence-blocks/entry-loop-taxonomies.php” location.
Is there any other directive to override the entry-loop-taxonomies.php ?
I’ve only copied this file..
Not only in meta. I’m wondering if could be possible to show the tag field like the category.
But I’m testing kadence only, so for now I’ll discard going to pro ATM.
I’ll try if I can modify the code to show the tag field.Regards,
Marking as solved, please.
Solved modifying the post-custom-field.php template.
<?php //extract styles & classes extract($extra_attr); ?> <div class="<?php echo esc_attr( $wrapper_class ); ?>" <?php if ( !empty($wrapper_style) ) { ?> style="<?php echo esc_attr($wrapper_style); ?>" <?php } ?>> <?php if ( !empty($attributes['customField'] ) ) { /* ORIGINAL CODE echo get_post_meta( get_the_ID(), esc_attr( $attributes['customField'] ), true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ $cfield=get_post_meta( get_the_ID(), esc_attr( $attributes['customField'] ), true ); if (!empty($cfield)){ if(strlen($cfield) == 2){ $term= get_term($cfield); echo $term->slug; }else { if (strlen($cfield)==8){ $year=substr($cfield,0,4); $month=substr($cfield,4,2); setlocale(LC_TIME, 'es_ES.UTF-8'); $dateObj = DateTime::createFromFormat('!m', $month); $timestamp=strtotime($cfield); echo date_i18n("F Y ",$timestamp); } } } } ?> </div>
Done it! (perhaps in a not very right way, but it works ??
For posterity:
I modified the content of post-custom-field.php as suggested but I only formated my unformated fields, datetimes and customtaxonomy.
Please forgive my base skills in this:
<?php
//extract styles & classes
extract($extra_attr);
?><div class=”<?php echo esc_attr( $wrapper_class ); ?>” <?php if ( !empty($wrapper_style) ) { ?> style=”<?php echo esc_attr($wrapper_style); ?>” <?php } ?>>
<?php if ( !empty($attributes[‘customField’] ) ) {
/* ORIGINAL CODE
echo get_post_meta( get_the_ID(), esc_attr( $attributes[‘customField’] ), true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
*/
$cfield=get_post_meta( get_the_ID(), esc_attr( $attributes[‘customField’] ), true );
if (!empty($cfield)){
if(strlen($cfield) == 2){
$term= get_term($cfield);
echo $term->slug;
}else {
if (strlen($cfield)==8){
$year=substr($cfield,0,4);
$month=substr($cfield,4,2);
setlocale(LC_TIME, ‘es_ES.UTF-8’);
$dateObj = DateTime::createFromFormat(‘!m’, $month);
$timestamp=strtotime($cfield);
echo date_i18n(“F Y “,$timestamp);
}
}
}
} ?>
</div>Thanks!
Ok I supose I must dive in this code from: /includes/templates/template-parts/post-custom-field.php
<?php //extract styles & classes extract($extra_attr); ?> <div class="<?php echo esc_attr( $wrapper_class ); ?>" <?php if ( !empty($wrapper_style) ) { ?> style="<?php echo esc_attr($wrapper_style); ?>" <?php } ?>> <?php if ( !empty($attributes['customField'] ) ) { echo get_post_meta( get_the_ID(), esc_attr( $attributes['customField'] ), true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } ?> </div>
As I’m a newcomer to wordpress code I will need some time to render the taxonomy name.
Let me try and I’ll post the results.Thank you very much!
- This reply was modified 2 years, 3 months ago by xarz.
Oh crap, My desktop size was obscuring the size selecion…
Don’t mind this thread.
Forum: Plugins
In reply to: [Getwid - Gutenberg Blocks] Custom Post Type can show CPT Taxonomies?Only for clarification:
I’ve (mostly) achieved my goal using ACF fields.
1. I created and ACF field called taxonomy, and used the options load values and saves values to CPT.
2. Used custom fields block to show in your CPT template the taxonomy field. But It only shows id and don’t render the taxonomy name…I supose I must manipulate the template with code for achieving to show the taxonomy name. But I don’t know how to do it.(yet)My suggestion is the same: you already let to choose displat featured image, excerpt and description in the templates…if custom taxonomy can be added for display without acf it would be a great thing IMHO.