• Resolved ukrainaevents

    (@ukrainaevents)


    Hi, help me please.

    I use hello elementor them.

    I add ACF to my standart post term – https://i.imgur.com/fB9cBh7.png

    Next, I try output the field there ..themes/hello-elementor/template-parts/archive.php:

    
    ...
    
    <main id="content" class="site-main" role="main">
    
    	<?php if ( apply_filters( 'hello_elementor_page_title', true ) ) : ?>
    		<header class="page-header">
    			<?php
    			
    			//the_archive_title( '<h1 class="entry-title">', '</h1>' );
    			
    			$term = get_queried_object();
    			$seotitle = get_field('h1-cat', $term->taxonomy . '_' . $term->term_id);
    			echo $seotitle;
    			
    			if($seotitle){
    			 "<h1 class='entry-title'>" . $seotitle .   "</h1>" ;
    			}
    			else 	if(!$seotitle){  
    				the_archive_title( '<h1 class="entry-title">', '</h1>' );  ;
    				
    			}			
    			
    			the_archive_description( '<p class="archive-description">', '</p>' );
    			
    			?>
    		</header>


    `

    But – $seotitle; is empty….. Where I wrong?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get Term field from archive page’ is closed to new replies.