First, you register your setting like this:
function my_awesome_register_fields_for_additional_settings(){
register_setting('reading', 'my_awesome_pagelink_for_frontend_button');
add_settings_field('my_awesome_pagelink_for_frontend_button', '<label for="my_awesome_pagelink_for_frontend_button">The Frontend Button shall link to this page:</label>' , 'my_awesome_pagelink_for_frontend_button_html', 'reading');
}
add_filter('admin_init', 'my_awesome_register_fields_for_additional_settings');
After that, you define the callback for your settings field:
function my_awesome_pagelink_for_frontend_button_html(){
$option = (int)get_option('my_awesome_pagelink_for_frontend_button',0);
wp_dropdown_pages(array(
'selected' => $option,
'name' => 'my_awesome_pagelink_for_frontend_button',
'show_option_none' => 'Please Choose',
'option_none_value' => 0,
));
}
The wp_dropdown_pages function uses the Page-ID as values, so you're already set.
All you need to do now is to echo your button in the front-end like this:
if($buttonlink = (int)get_option('my_awesome_pagelink_for_frontend_button',0)){
?><a href="<?php echo get_permalink($buttonlink); ?>" class="button"><?php echo get_the_title($buttonlink); ?></a><?php
}
Happy Coding,
Kuchenundkakao
Edit: language.