• Resolved SforSteph

    (@sforsteph)


    Hi, great plugin!

    The main issue that I’ve run into however, is where Cook Time is 0 minutes – I want to be able to make this clear that, in the case of a salad for example, there’s 10 mins prep but zero minutes cooking – however, entering 0 for the Cook Time minutes means that this disappears from the front end? Any way I can get zero minutes to show?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Brecht

    (@brechtvds)

    Hi there,

    In our recipe template it checks if the value is set and not 0 before displaying.

    You could make a copy of the template you’d like to use and remove the check in there: https://bootstrapped.ventures/wp-recipe-maker/create-your-own-template/

    Kind regards,
    Brecht

    Thread Starter SforSteph

    (@sforsteph)

    That’s very helpful, thank you.

    I have my custom template set up – however I can’t find where the check for 0 is?

    <?php if ( $recipe->cook_time() ) : ?>
    			<div class="wprm-recipe-time-container">
    			<meta itemprop="cookTime" content="PT<?php echo $recipe->cook_time(); ?>M" />
    				<div class="wprm-recipe-time-header"><?php _e( 'Cook Time', 'wp-recipe-maker' ); ?></div>
    				<div class="wprm-recipe-time"><?php echo $recipe->cook_time_formatted( true ); ?></div>
    			</div>
    		<?php endif; // Cook time. ?>

    Can you point me in the right direction?

    Plugin Author Brecht

    (@brechtvds)

    Try something like this:

    <div class="wprm-recipe-time-container">
        <?php if ( $recipe->cook_time() ) : ?>
        <meta itemprop="cookTime" content="PT<?php echo $recipe->cook_time(); ?>M" />
        <?php endif; // Cook time. ?>
        <div class="wprm-recipe-time-header"><?php _e( 'Cook Time', 'wp-recipe-maker' ); ?></div>
        <div class="wprm-recipe-time"><?php echo $recipe->cook_time() ? $recipe->cook_time_formatted( true ) : '0 minutes'; ?></div>
    </div>
    Thread Starter SforSteph

    (@sforsteph)

    Works perfectly – thanks so much ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Zero Minutes Cook Time?’ is closed to new replies.