• I made a code (on localhost) that makes checkboxes for each page currently in WordPress. Now I get the page ID and title when someone submits the checkbox form.

    Now I need it to display the page’s featured image as well but I canoot find out the exact code to put in the value for that, or if I must make a variable first.

    I tried this code: $the_post_thumbnail(); but nothing displayed

    foreach ($pages as $page){
            $a = $a + 1;
            echo "<input type='checkbox' name='$a' value='$page->post_title $page->ID)'>";
            echo "<label> $page->post_title </label>";
            echo "<br/>";
        }

    Does anyone know what I am missing? Thanks in advance

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Putting featured image in page label(value)’ is closed to new replies.