Bonjour à tous,
j’essaye de crée une page option sur mon site,
j’utilise ce tuto : http://www.geekeries.fr/developpement-web/creer-page-options-theme-wordpress-10368
je n’arrive pas a bien concevoir ma page function/index.php
si on suis bien le tuto ça devrais donner un truc du genre
mais ça ne marche pas …
<?php
add_action('admin_menu', 'GkMenu');
function GkMenu() {
add_menu_page('Paramètres du blog', 'Paramètres', 'administrator', 'Blog', 'GkLtextes', 'http://www.geekeries.fr/gk.png', '3');
add_action( 'admin_init', 'register_mysettings' );
}
function register_mysettings() {
//Paramètres de la page
register_setting( 'gkltextes', 'txt1' );
register_setting( 'gkltextes', 'txt2' );
}
function GkLtextes() {
if ( $_REQUEST['updated'] )
echo '
<div id="message" class="updated">
<p>C’est sauvegardé :)</p>
</div>
‘;
?>
<div class="wrap">
<div id="icon-edit" class="icon32"></div>
<p style="margin-top:30px;"><a name="les-options-du-blog"></a></p><h2><a href="#sommaire" title="Retour au sommaire" rel="nofollow"><img src="http://www.geekeries.fr/wp-content/plugins/anchor-links/arrowtop.png" style="float: left; margin: -13px 5px -5px 0px;border: 0px;"alt="Retour au sommaire" /></a> Les options du blog</h2>
<table class="widefat">
<thead>
<tr>
<th>Accueil</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<form method="post" action="options.php">
<?php settings_fields( 'gkltextes' ); ?>
<input type="text" name="txt1" value="<?php echo get_option('txt1'); ?/> » />
</form></td>
</tr><tr>
<td>
<form method="post" action="options.php">
<?php settings_fields( 'gkltextes' ); ?>
<input type="text" name="txt2" value="<?php echo get_option('txt2'); ?/> » />
</form></td>
</tr>
</tbody>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?/> » />
</p>
</div>
<?php } ?>
?>
avez une solution alternative ou pouvez vous m’aider svp ?
merci d’avance
bonne journée