Created
April 18, 2020 11:57
-
-
Save nunomorgadinho/d5539d3ca9a223006fe82110dff1b325 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The template for displaying single posts and pages. | |
* | |
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/ | |
* | |
* @package WordPress | |
* @subpackage Twenty_Twenty | |
* @since Twenty Twenty 1.0 | |
*/ | |
get_header(); | |
?> | |
Tipo de Prato: <?php the_field('tipo_de_prato'); ?><br/> | |
Tempo de Preparação: <?php the_field('tempo_de_preparacao'); ?><br/> | |
Nível de Dificuldade: <?php the_field('nivel_de_dificuldade'); ?><br/><br/> | |
Tipo de Cozinha: <?php the_terms( get_the_ID(), 'tipo_de_cozinha' ); ?><br/> | |
Ingredientes: <br/> | |
<ul> | |
<?php | |
// check if the repeater field has rows of data | |
if( have_rows('ingredientes') ): | |
// loop through the rows of data | |
while ( have_rows('ingredientes') ) : the_row(); | |
// display a sub field value | |
echo "<li>"; | |
the_sub_field('nome_do_ingrediente'); | |
echo " - "; | |
the_sub_field('quantidade_do_ingrediente'); | |
echo "</li>"; | |
endwhile; | |
else : | |
// no rows found | |
endif; | |
?> | |
</ul> | |
<main id="site-content" role="main"> | |
<?php | |
if ( have_posts() ) { | |
while ( have_posts() ) { | |
the_post(); | |
get_template_part( 'template-parts/content', get_post_type() ); | |
} | |
} | |
?> | |
</main><!-- #site-content --> | |
<?php get_template_part( 'template-parts/footer-menus-widgets' ); ?> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment