I hope i’lll explain this correctly.

here’s my drop down list

$html .= '<select name="pp-dropdown_'.$i.'"> 
<option value="">' . attribute_escape(__('Select page')) . '</option> '; ?>
<?php 
    $pages = get_pages(); 
    foreach ($pages as $pagg) {
        $html .= '<option value="'.get_page_link($pagg->ID).'"' . selected( $hero_options['page_link_'.$i.''], ''.get_page_link($pagg->ID).'', false) . '>';
        $html .= $hero_options['hero_buttons'];
        $html .= '</option>';
    }
?>

‘;

Basically, if there’s nothing store in

$hero_options['hero_buttons']

I want to display

$pagg->post_title

How can I do this?

Read more here: If wordpress option empty, show page list


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: