[PRO] ACF + Post show meta

Hello,

I did a ACF group fields and shows when I’m doing post with category called “neuromidia”.
But, the problem is: show the meta keys by default (from each post with this category) and, when list from category (/cat/neuromidia), show the external link from ACF instead own permalink post. How to solve it? Can you help me?

What I read already:
Theme.co - How to make custom template for custom post type
Theme.co - Integrated Plugins - ACF PRO
ACF Resources
ACF - Displaying custom field values in your theme

What I have tried to:
Using The Grid, a custom grid with meta, because I need to play media with lightbox when have it and, the title with external link. The problem? The date format from ACF is Ymd only.

Maybe, if I have a custom post format for my category, I can input the PHP codes from ACF Pro. What do you think? What to do it?

Thank you very much.

  1. I have tried to copy /pro/framework/views/global/_content.php to /pro-child/framework/views/global/_content.php
    Target: show full content in the specific category archive (/cat/neuromidia)
    Question: What I need to change here?

  2. I need a specific customization for posts for specific category. Which file or files I need to copy? And what to change into these files? (I have some PHP code from ACF Pro)

I think that this way is better to show my ACF data handling from meta.

The fields from ACF Pro:

<?php the_field( 'titulo_do_clipping' ); ?>
<?php the_field( 'data_publicacao' ); ?>
<?php the_field( 'nome_veiculo' ); ?>
<?php the_field( 'tipo_veiculo' ); ?>
<?php the_field( 'link_publicacao' ); ?>
<?php if ( get_field( 'upload_img' ) ) { ?>
	<a href="<?php the_field( 'upload_img' ); ?>">Download File</a>
<?php } ?>

Thank you for your support.

Hello There,

Thank you for the very detailed post information.

1.) You will have to add modify the condition so that full content will be displayed when the category is neuromidia. The contents of _content.php should be like this:

<?php

// =============================================================================
// VIEWS/GLOBAL/_CONTENT.PHP
// -----------------------------------------------------------------------------
// Display of the_excerpt() or the_content() for various entries.
// =============================================================================

$stack                     = x_get_stack();
$is_full_post_content_blog = is_home() && x_get_option( 'x_blog_enable_full_post_content' ) == '1';

?>

<?php

if ( is_singular() || $is_full_post_content_blog || is_category('neuromidia') ) :
  x_get_view( 'global', '_content', 'the-content' );
  if ( $stack == 'renew' ) :
    x_get_view( 'renew', '_content', 'post-footer' );
  endif;
else :
  x_get_view( 'global', '_content', 'the-excerpt' );
endif;

?>

2.) You will need to copy the file /pro/framework/views/global/_content-the-content.php to /pro-child/framework/views/global/_content-the-content.php and modify the code like this:

<?php

// =============================================================================
// VIEWS/GLOBAL/_CONTENT-THE-CONTENT.PHP
// -----------------------------------------------------------------------------
// Display of the_content() for various entries.
// =============================================================================

?>

<?php do_action( 'x_before_the_content_begin' ); ?>

<div class="entry-content content">

<?php do_action( 'x_after_the_content_begin' ); ?>

  <?php the_content(); ?>


  <?php if ( in_category('neuromidia') ) : ?>
  	<?php the_field( 'titulo_do_clipping' ); ?>
	<?php the_field( 'data_publicacao' ); ?>
	<?php the_field( 'nome_veiculo' ); ?>
	<?php the_field( 'tipo_veiculo' ); ?>
	<?php the_field( 'link_publicacao' ); ?>
	<?php if ( get_field( 'upload_img' ) ) { ?>
		<a href="<?php the_field( 'upload_img' ); ?>">Download File</a>
	<?php } ?>
  <?php endif; ?>

  <?php x_link_pages(); ?>

<?php do_action( 'x_before_the_content_end' ); ?>

</div>

<?php do_action( 'x_after_the_content_end' ); ?>

Hope this helps. Please let us know how it goes.

1 Like

Please, confirm: lightbox can open png/jpg/pdf/audio/video, right?

Hi there,

It should be.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.