Using is_plugin_active within functions.php

How about this? function useragent_shortcode($tag) { include_once( ABSPATH . ‘wp-admin/includes/plugin.php’ ); if ( is_plugin_active(‘contact-form-7/wp-contact-form-7.php’) ) { if ( ! is_array( $tag ) ) return ”; $options = (array) $tag[‘options’]; foreach ( $options as $option ) { if ( preg_match( ‘%^name:([-0-9a-zA-Z_]+)$%’, $option, $matches ) ){ $name_att = $matches[1]; } $userAGENT .= $_SERVER[‘HTTP_USER_AGENT’]; } $user_agent = $userAGENT; … Read more

WP Custom Comment Callback Not Responding

There is apparently some sort of query call that takes place as part of the comments_template() call, just as there is with loop calls. When I put my custom function in the comments template, it works perfectly. I tried putting the entire contents of the comments template into my custom loop-single template, and it didn’t … Read more

Retrive post by tags PHP code

I think there are multiple issues here: 1) Because you’re using query_posts() the post object’s query_vars are inherited by your new query_posts(). I suspect then, that ‘post_type’ => ‘persoane’ is implicitly part of that query posts call. If you switch to using WP_Query instead of query posts, I suspect that will fix the issue. 2) … Read more