Warning: in_array() null given in PHP function

Well first you have this code // no matter what the value here, you can forget about it (because in the next line of code you assing a new value to the same variable) $post_types = apply_filters( ‘sortable_wordpress_gallery_post_types’, array( ‘post’ ) ); // only this really matters $post_types = apply_filters( ‘sortable_wordpress_gallery_’ . $this->id . ‘_post_types’, … Read more

Sortable column (by numbers) in admin users

Is there something that I’m missing Yes, you need to actually add the function which will do the sorting based on your usercoins “sort by” value (that you set in your yoursite_manage_users_custom_column_sortable() function). So you would hook your function on users_list_table_query_args, then change the args so that the users are being sorted by the usercoins … Read more

Include the post type before the title of search results

I solved this by copying the divi index.php and placing it in my child theme as search.php I then found where the title and altered it with the below code: <h2 class=”entry-title”> <a href=”<?php the_permalink(); ?>”> <?php $post_type = get_post_type( $post->ID ); echo $post_type . “: “; the_title(); ?> </a> </h2> Probably not the correct … Read more

How to Use Global Variables Inside Header and Footer

In functions.php you can create a constant with the user id, like this. // if somehow this constant exists this will prevent a php error if (!defined(‘CURRENT_USER_ID’)) { // if user is not logged it this constant will contain 0 define(‘CURRENT_USER_ID’, get_current_user_id()); } Now you have a constant variable available anywhere in your theme. To … Read more