Authors details such as social media links, emails etc → Is this Meta or something else?

Add user contact methods using the user_contactmethods filter in your theme’s functions.php or via a plugin: User contact method entries are stored in the wp_usermeta table. The URL field is special; it’s stored in the user_url field in the wp_users table. // Add user contact methods add_filter( ‘user_contactmethods’,’wpse_user_contactmethods’, 10, 1 ); function wpse_user_contactmethods( $contact_methods ) … Read more

Set default options for inserting media

You can do this in two ways. If you want to keep it theme specific, edit your functions.php file with this code: add_action( ‘after_setup_theme’, ‘my_new_default_image_settings’ ); function my_new_default_image_settings() { update_option( ‘image_default_align’, ‘right’ ); update_option( ‘image_default_link_type’, ‘file’ ); } The other way to do it is more general, but also more rigid: Go to YOURSITE.COM/wp-admin/options.php Find … Read more

Order get_users() by last login date. Is it possible?

First, you need to store the actual login date, because this is not stored by default. You can use this code to do that(use it in your functions.php) add_action(‘wp_login’,’user_last_login’, 0, 2); function user_last_login($login, $user) { $user = get_user_by(‘login’,$login); $now = time(); update_usermeta( $user->ID, ‘user_last_login’, $now ); } After that, you can use the meta field … Read more

Change ul class=”children” for wp_list_pages?

You can override this by supplying your on Walker Object when calling wp_list_pages, like this: <your-template>.php wp_list_pages(array( ‘title_li’ => null, ‘depth’ => 2, ‘child_of’ => 0, ‘walker’ => new My_Walker(), )); Instead of the default Walker_Page this will make wp_list_pages use your custom walker, My_Walker. The only difference we need here is to make your … Read more

Add class to Categories Widget

Here is a little jQuery snippet I made that should do what you want it to do (this just works for the category widget): // JavaScript Document $j = jQuery.noConflict(); $j(document).ready(function(){ $j(‘li.cat-item-1’).parent().addClass(‘test’); }); If you wanted to do this to all widgets, well it depends on the parent element of the widgets. Let’s say there’s … Read more

How to integrate owl carousel into theme without using a plugin?

You’re reusing handles for the script and the styles. These need to be unique values (see WP Codex Reference) It should look something like this: wp_enqueue_script( ‘owlcarousel’, get_template_directory_uri() . ‘/inc/owl/owl.carousel.min.js’, array( ‘jquery’ ), false, true ); wp_enqueue_script( ‘owlcarousel-init’, get_template_directory_uri() . ‘/inc/owl/owl.carousel-init.js’, array( ‘jquery’ ), false, true ); wp_enqueue_style( ‘owlcarousel-style’, get_template_directory_uri() . ‘/inc/owl/owl.carousel.css’ ); wp_enqueue_style( ‘owlcarousel-theme’, … Read more