Need a little bit of help here. I am adding this dropdown to my options panel. However, when I call my option in my template. It does not display
Here is the function for the dropdown:
function page_test_setting(){
$options = get_option('meta_options');
$pages = get_pages();
echo '<select name="meta_options[page_test]">';
echo "<option value='{$options['page_test']}'>";
echo esc_attr( __( 'Select page' ) );
echo "</option>";
foreach ( $pages as $page ) {
$option = '<option value="' . get_page_link( $page->ID ) . '">';
$option .= $page->post_title;
$option .= '</option>';
echo $option;
echo '</select>';
}
}
The options field:
add_settings_field('page_test', 'PAGE OUTPUT', 'page_test_setting', __FILE__, 'meta_section');
And here is how I am calling it in my theme:
<?php echo get_permalink($options['page_test']); ?>
As you can probably guess is that I want the CALL to pull the page title and link to the appropiate page. Should I be using page titles instead for the call or what?
Okay, I found the solution incase anyone else is need to do the same thing.
}