keithg

add Text box in setting page – wordpress

Add code in function.php add_filter(‘admin_init’, ‘fbfn’); function fbfn() { register_setting(‘general’, ‘fb_id’, ‘esc_attr’); add_settings_field(‘fb_id’,”.__(‘Become a fan ‘ , ‘fb_id’ ).” , ‘fb_html’, ‘general’); } function fb_html() { $fb = get_option( ‘fb_id’, ” ); echo “<input type=’text’ id=’fb_id’ name=’fb_id’ value='”.$fb.”‘ >”; }  Read more …
keithg

inline javascript and css using hook – wordpress

add_action( ‘wp_head’, ‘print_my_custom_scripts’ ); function print_my_custom_scripts() { print ‘<script type=”text/javascript”>jQuery(document).ready(function() { alert(‘WordPress’)   });</script>’; print ‘<style type=”text/css”>.align{margin-left:32px;}</style>’; }Read more …
keithg

hide pages from page list

add_filter( ‘parse_query’, ‘exclude_pages_from_admin’ ); function exclude_pages_from_admin($query) { global $pagenow,$post_type; if (is_admin() && $pagenow==’edit.php’ && $post_type ==’page’) { $query->query_vars[‘post__not_in’] = array(‘156′,’157′,’167′,’159′,’74’,’158′,’160′,’161′,’169′,’71’); } }Read more …
dhavalp

WordPress wp-admin login issue

when we try to access wp-admin and get error “Warning: Cannot modify header information – headers already sent by (output started at /websites/LinuxPackage05/7y/tz/nj/mysite-hosting.co.uk/public_html/wp-includes/pluggable.php:1) in /websites/LinuxPackage05/7y/tz/nj/7ytznj-256344.mysite-hosting.co.uk/public_html/wp-includes/pluggable.php on line 898” and can not access wp-admin then it will be plugin conflict issue. So normally you would have to deactivate all plugin and...Read more …
dhavalp

Fatal Error on plugin installation

I got the error “Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 49152 bytes) in /home/wellington/public_html/dev/wp-admin/includes/file.php on line 357” when installing plugin in wordpress. By default, WordPress automatically tries to increase PHP memory limit if it is less than 64MB. However, 64MB is often not high...Read more …