Tag Info

Hot answers tagged

2

Add a meta box to your custom post type edit screen to contain your markup. Check the $pagenow global to only show it on post.php, not post-new.php, and check $current_user global for administrator role to exclude other user roles. Also, if you aren't familiar, check out the $wpdb class for your queries, and read up on using AJAX in WordPress. EDIT use ...


2

The limitation is down to the existing arguments and how pretty much all widgets typically output content: echo $args['before_widget']; if ( $title ) { echo $args['before_title'] . $title . $args['after_title']; } // Widget content echo $args['after_widget']; Some widgets may offer before/after content hooks, but if you want a "global" fix there's ...


1

Your snippet seems mostly ok, except that dependency is a list and should be array('jquery'). Also wp_enqueue_scripts should be use as more appropriate. You can check out Codex documentation for a complete example, see Example of Automatic Dependency Loading.


1

Use wp_register_script & wp_enqueue_script to enqueue the scripts the right way. add_action( 'wp_enqueue_scripts', 'enqueue_my_script' ); function enqueue_my_script() { wp_register_script( 'my-script', get_template_directory_uri() . '/cycle2.js', array( 'jquery' ) ); wp_register_script( 'enq-jquery', ...


1

Use the proper charset in you website according with the characters you use, that is the correct solution from my point of view. What your are trying is some work around that don't fix the real issue. You must note that UTF-8 is the standard enconding recommend for internet nowdays. ISO-8859-1 was considered the standard for 4.01, although most of the ...


1

You are trying to access the meta data of the user with ID stored in $user->ID but the object $user is not defined in your code. You are also using an undefined variable $user_ID. The quickest fix in your code would be to change this: get_the_author_meta( 'province', $user->ID ) ) With: get_the_author_meta( 'province', $userdata->ID ) ) Tip: ...


1

You should place this function into your theme's functions.php. Never mess with the core WordPress files (anything in the wp-includes, wp-admin directory). An error can lead to a non functioning site, and the files get updated. WordPress never updates your custom themes, so this is the way to go. Of course, if you have a lot of functions, you can create a ...



Only top voted, non community-wiki answers of a minimum length are eligible