How to add image for custom taxonomy

You can use get_object_taxonomies() as your solution. Returns all the taxonomies for a post type or post object: <?php get_object_taxonomies( $object, $output ); ?> Have you tried anything? something like this? // taxonomy term archives $post_type = get_post_type(); // find out if CPT $taxonomies = get_object_taxonomies($post_type); // Find taxonomies if($taxonomies){ foreach($taxonomies as $taxonomy){ // only … Read more

display php code in header using wp_head()

As per my understanding you wish to print content from get_option below . For that please write below code to funcitons.php file: function my_facebook_tags() { return $options = get_option(“p2h_theme_options”); } And below code within your header file below to wp_head() write: <?php echo my_facebook_tags();?> Hope this will resolve the issue for you! EDITED: Try the … Read more

echo statement repeats

I do not believe that the root issue exists within the code provided. I tested an even further reduced test case which I’ve pasted below, and I do not get duplicated content: function my_module_init() { add_filter(‘the_content’, ‘my_content_ctrlr’); } add_action(‘init’, ‘my_module_init’); function my_content_ctrlr( $content ) { ob_start(); // This file contains only the following simple text … Read more

How to show data on a table

I found what was wrong, just switch this: function column_default($item, $column_name){ switch($column_name){ case ‘rating’: case ‘director’: return $item[$column_name]; default: return print_r($item,true); //Show the whole array for troubleshooting purposes } } To this: function column_default($item, $column_name){ switch($column_name){ case ‘id’: return $item[‘plan_id’]; case ‘plano’: return $item[‘plan_name’]; case ‘dias’: return $item[‘plan_days’]; case ‘valor’: return ‘R$ ‘ . number_format($item[‘plan_price’], … Read more

check wp_login into a plugin

Well, you get user data in global $current_user variable only when a user is online or in other words, this is the data of currently logged user. I think the problem is not with the hook or data, but with your insert code. It should be like this: // You get two parameters, 2nd param … Read more