Tag Info

New answers tagged

0

go to your function php past this code function fb_add_custom_user_profile_fields( $user ) { ?> <h3><?php _e('Extra Profile Information', 'your_textdomain'); ?></h3> <table class="form-table"> <tr> <th> <label for="address"><?php _e('Address', 'your_textdomain'); ?> ...


2

Per comments, it's called with call_user_func_array, so the 1st 2 elements get assigned to the declared arguments $elements and $max_depth, leaving the third element ($r which is the original $args) to be assigned via array_slice to $args. Eg function wpse172812( $elements, $max_depth ) { $args = array_slice(func_get_args(), 2); ...


0

I Found my mistake. Basically, I had a bad prefix... I changed the function name of the get_post_meta to $gwrrest_stored_meta but then missed it in the echo of the text area content. I had "recycled" my code and accidentally left is as $prfx_stored_meta. So the line here: <textarea name="specials-textarea" id="specials-textarea"><?php if ( ...


0

You can get same result by outputting values from PHP array. Since it is multicolumn array, you will need to run foreach loop and get values of each child item. Mostly it's standard PHP stuff, nothing special. Although earlier you did not need to supply post ID in each WordPress function since you were using it inside a loop, but now you will have to do ...


2

Open comments.php file inside your theme's folder <?php if ( comments_open() ) : ?> <?php $fields = array( 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name', 'responsive' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . '<input id="author" ...


0

Yes, you'll want to create custom metaboxes for those. This is a pretty good intro into how to do that. But you might want to think through a few things: Are you sure you want that added to ALL posts? If not, perhaps create a custom post type and attach those fields to that post type instead. Maybe you really DO want it on Posts and not a Custom Post Type, ...


1

You typed "mobiles" when you said you wanted to check for post type "mobile". So simply remove the s ;). <? if( post_type_exists( 'mobiles' ) ) { echo 'The Products post type exists';} ?> Should be: <? if( post_type_exists( 'mobile' ) ) { echo 'The Mobile post type exists';} ?> If it's still not working, triple check if you ...


1

You may also want to remove the meta boxes from the Post Creation page // REMOVE POST META BOXES function remove_my_post_metaboxes() { remove_meta_box( 'categorydiv','post','normal' ); // Categories Metabox remove_meta_box( 'tagsdiv-post_tag','post','normal' ); // Tags Metabox } add_action('admin_menu','remove_my_post_metaboxes');


1

By using get_post_meta() fetch the custom field data $key_value = get_post_meta( get_the_ID(), 'key', true ); // check if the custom field has a value if( ! empty( $key_value ) ) { echo $key_value; } also see for more detail get_post_meta()


1

See get_post_meta() Example: get_post_meta($post->ID, 'EXAMPLEFIELD', true);


0

Andrew Bartel is on the right path, but the link doesn't quite do what you want. For static PHP files to access WordPress core functionality you need to add this to the top of the PHP file: define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */ require( dirname( __FILE__ ) . '/wp-blog-header.php' ); (This code is from ...


0

Here is a sophisticated way of creating the social links and then retrieving them back where you need using a simple function. You can use this function to create a shortcode too. (I copied the code from one of my project, so you might want to change some of the class prefixes if you like). /*-----------------------------------------------------------*/ ...


2

Of course you can specify only the items you want to remove. Have a look in the code below: /wordpress/wp-content/plugins/your_plugin/your_plugin.php : add_action('admin_init', 'nwcm_admin_init'); function nwcm_admin_init() { // Remove unnecessary menus $menus_to_remove = array( // menu items you want to remove 'menu_item_1', ...


2

From /wp-includes/script-loader.php: $scripts->add( 'media-grid', "/wp-includes/js/media-grid$suffix.js", array( 'media-editor' ), false, 1 ); From wp-admin/upload.php: wp_enqueue_script( 'media-grid' ); wp_enqueue_script( 'media' ); wp_localize_script( 'media-grid', '_wpMediaGridSettings', array( 'adminUrl' => parse_url( self_admin_url(), ...



Top 50 recent answers are included