• Resolved xarz

    (@xarz)


    Hello.

    First, thanks for your great contribution. These blocks are great,specially the Custom Post Type block. These post template options are marvellous.

    Perhaps as a suggestion: it could be interesting to show in the templates custom type taxonomies? Is there possible to add this feature?
    And the fields related to this custom type to show in the custom type templates?

    Regards and thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support eugenewhite

    (@eugenewhite)

    Hello there!

    “Perhaps as a suggestion: it could be interesting to show in the templates custom type taxonomies? Is there possible to add this feature?”

    Could you please clarify this request in more detail? Do you mean you wish to show the list of taxonomy terms each post is related to? It would be helpful if you could share some examples or screenshots of what you would like to achieve.

    “And the fields related to this custom type to show in the custom type templates?” – Please be aware that it’s possible to add Custom Field blocks to the Post Template editor.

    Thread Starter xarz

    (@xarz)

    – As for taxonomy terms. For instance:

    Imagine a grid view option set of your Custom Post Template block
    In each column you’ll see the content that has the template (default or custom).

    This content for each column will be shown as per classic template:

    Feat. Image
    Title
    {Taxonomy terms}*
    Exerpt

    The Taxonomy terms*, will be the taxonomy terms of the Custom Type diferent of wordpress base taxonomies.
    Like https://pasteboard.co/DUPWRNIiAOpc.png

    For the second sugestion:

    I know about the custom field block, but if I pull the field from database I see it unformated. I was thinking if may be possible in the moment of choosing the custom type, then another option to add one or more fields related to this custom type post.

    Example:
    Event Type Post:
    Title, feat img, exerpt, EventEndTime, EventStartTime, Location, coordinator…

    Thanks in advance.

    Plugin Support eugenewhite

    (@eugenewhite)

    Hello there!

    Thank you for your suggestions and for providing the details and examples. We sure let our developers know about them and we hope they consider such improvements implementations in future versions of the plugin.

    Thread Starter xarz

    (@xarz)

    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.

    Plugin Support eugenewhite

    (@eugenewhite)

    Hello there!

    Well, in this case, I may only suggest you try rewriting the “post-custom-field.php” that may be found here: “\getwid\template-parts\*”, with the next code:

    <?php
    
    //extract styles & classes
    extract($extra_attr);
    
    $field_name = $attributes['customField'];
    
    if($field_name === 'YOUR_FIELD') {
    
     ??$terms = get_field( esc_attr( $field_name ), get_the_ID() );
    
      ?>
    
      <div class="<?php echo esc_attr( $wrapper_class ); ?>" <?php if ( !empty($wrapper_style) ) { ?> st yle="<?php echo esc_attr($wrapper_style); ?>" <?php } ?>>
          <?php foreach ($terms as $term) {
              ?>
              <span><?php echo esc_html( $term->name ); ?></span>
              <?php
          }        
      </div>
      <?php
    
    } else {
    
      ?>
      <div class="<?php echo esc_attr( $wrapper_class ); ?>" <?php if ( !empty($wrapper_style) ) { ?> st yle="<?php echo esc_attr($wrapper_style); ?>" <?php } ?>>
          <?php if ( !empty($field_name ) ) {
              echo get_post_meta( get_the_ID(), esc_attr( $field_name ), true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
          } ?>
      </div>
      <?php
    
    }

    Where “YOUR_FIELD” should be replaced with the name of your custom field, obviously.

    Plugin Support eugenewhite

    (@eugenewhite)

    Hello there!

    I hope you’re doing well.
    I haven’t received a response from you and will mark this topic as resolved.
    In case you have any questions, feel free to create a new one.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom Post Type can show CPT Taxonomies?’ is closed to new replies.