Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Sanabria/414ad6341849229351ad29002194beb2 to your computer and use it in GitHub Desktop.

Select an option

Save Sanabria/414ad6341849229351ad29002194beb2 to your computer and use it in GitHub Desktop.

Revisions

  1. @bhongy bhongy revised this gist Jul 11, 2021. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions Wordpress: Do if the_content is not empty
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,4 @@
    <?php
    $thecontent = get_the_content();
    if(!empty($thecontent)) { ?>
    <?php if ( get_the_content() ) { ?>

    // do or output something

  2. @bhongy bhongy revised this gist Sep 30, 2013. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions Wordpress: Do if the_content is not empty
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    <?php
    $thecontent = get_the_content();
    if(!empty($thecontent)) {
    if(!empty($thecontent)) { ?>

    // do or output something
    }

    <?php } ?> // break php tag for HTML block
  3. @bhongy bhongy created this gist Sep 30, 2013.
    5 changes: 5 additions & 0 deletions Wordpress: Do if the_content is not empty
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    <?php
    $thecontent = get_the_content();
    if(!empty($thecontent)) {
    // do or output something
    }