Adding PHP to an if else loop

admin2025-06-04  0

I want to run some PHP to show custom fields in a page;

    <?php

$showExcerpt = get_theme_mod( 'auto_excerpt' , '' );

if( is_single() ) {

    the_content();


} else {

    if ( $post->post_excerpt ) {

            the_excerpt();

        ?>

I want to add the code after the content if the page is single, otherwise I do not want to show the PHP if it is just showing an excerpt.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749049951a315927.html

最新回复(0)