How do I get the value of a current user’s custom field?

Add this to the frontend and you should be able to adjust it to display whatever field you’ve added. $user_info = get_userdata(get_current_user_id()); echo ‘Username: ‘ . $user_info->user_login . “<br>”; echo ‘User roles: ‘ . implode(‘, ‘, $user_info->roles) . “<br>”; echo ‘User ID: ‘ . $user_info->ID . “<br>”; echo ‘User Agent Department: ‘ . $user_info->agentdept . … Read more

Before & After Content – After Content directly below Before Content when using require_once

If the file you want to attach (eg. footer-registered-include.php) print/display some text, this text will be displayed in the time you include the file. To assign to the variable the content displayed by the included file you should: turn on output buffering include file contents of the output buffer and end output buffering function wpdev_before_after($content) … Read more

Modify content inside post before first publish

You should use save_post like the following: function modifyOnPost( $post_id ) { $post = get_post($post_id); //do stuff here before your post is created or updated } add_action( ‘save_post’, ‘modifyOnPost’ ); Read more here. Update: To give a deeper solution you could use wp_update_post( $post, $wp_error ); inside the modifyOnPost block to manipulate your post data.

Set URL Parameter Post Layout As Default

I want this to apply to all posts First off, making the content query string defaults to onepage is actually equivalent to enabling the onepage() for all URLs/pages. And for example to enable it by default on single post pages only (for any post types), then you can replace this: if( empty( $_GET[“content”] ) || … Read more