Will I be able to check when did a contact add me?

Add filter to bloginfo wordpress?

  • I am a bit new to this so I hope this makes sense. I am trying to add an additional entry to general settings (admin page) that will populate the text on the homepage, similar to how the site title and tagline works. Currently these are the edits I have done. header.php: <div class="intl"><?php bloginfo('blognumber'); ?></div> options_general.php: <tr valign="top"> <th scope="row"><label for="blognumber"><?php _e('International Number') ?></label></th> <td><input name="blognumber" type="text" id="blognumber" value="<?php form_option('blognumber'); ?>" class="regular-text" /> <span class="description"><?php _e('International Contact Number') ?></span></td> general-template.php: <!-- (included a new case entry) --> function get_bloginfo( $show = '', $filter = 'raw' ) { switch( $show ) { case 'home' : // DEPRECATED case 'siteurl' : // DEPRECATED _deprecated_argument( __FUNCTION__, '2.2', sprintf( __('The <code>%s</code> option is deprecated for the family of <code>bloginfo()</code> functions.' ), $show ) . ' ' . sprintf( __( 'Use the <code>%s</code> option instead.' ), 'url' ) ); case 'url' : $output = home_url(); break; case 'wpurl' : $output = site_url(); break; case 'description': $output = get_option('blogdescription'); break; case 'number': $output = get_option('blognumber'); break; MySQL database entry: Added a new entry to to the wp_options table, entry name "blognumber" Everything appears to look right but when I go to save new text to the new field in the admin panel it just disappears. When I check MySQL the data does not save there either. Also instead of loading blank content it loads the filter <?php bloginfo "name" ?> instead (which I believe is the default). Can someone help me? I'm sure I'm just missing a simple line or there is an additional page I need to edit for this to work. Thanks

  • Answer:

    If you are editing a Wordpress function definition you can safely assume you are going about this the wrong way. You can add your own options via a theme or plugin functions file in a way that doesn't mess with the WP core - ensuring future updates don't conflict. See the link for details: http://codex.wordpress.org/Creating_Options_Pages

Eric at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.