WordPress plugin with its own “site”/theme

I don’t quite know what you mean by “include a theme” and you are talking about a potentially large and complicated project but I think you should be able to control the display of your plugin content with the template_redirect hook. function template_redir_wpse_99209($content) { // code or file include, for example // exit; } add_action(‘template_redirect’,’template_redir_wpse_99209′,1); … Read more

Checking for existing title in custom db query not working

use get_page_by_title to get post by title. I check for it on my system $post_exist=get_page_by_title( ‘Hello world!’, ARRAY_A, ‘post’ ); if( ! empty( $post_exist ) ) { echo ‘title exist’; } else { echo ‘title not exist’; } Running successfully. In your case it may be like $title=trim($titles_arr[$i]); $post_exist=get_page_by_title( $title, ARRAY_A, ‘post’ ); if( ! … Read more

How to get a notification when the plugin is installed?

I do not recommand using is_plugin_active() because if you rename your plugin directory which is done sometimes for security needs you’re screwed. If I were you I’d look into plugin you want to detect and select a core class or a core function of the plugin and test it with if(class_exists(‘name_of_the_class’)) or if(function_exists(‘name_of_the_function’)). Hope this … Read more

count the number of views of a post excluding own views

The plugin appears to be processing the view on the wp_head hook. That means you ought to be able to do something like this: function remove_view_counter_wpse_102637() { global $post; $current_user = wp_get_current_user(); if ( is_single() && !empty($current_user) && $post->post_author == $current_user->ID ) { remove_action(‘wp_head’, ‘process_postviews’); } } add_action(‘wp_head’, ‘remove_view_counter_wpse_102637′,1); No guarantees. I don’t use that … Read more