Show media-uploads to all users

The plugin you mentioned is only reportedly tested up to WordPress version 3.6.1. I would not (in general) recommend abandoned plugins, because they might impose security risks. Additionally it uses PHP4 class constructors, that might soon be deprecated and it calls non static methods in a static way. If you remove the plugin, you should … Read more

Restrict access to live site from public while showing small group the new site all on the same URL?

Put code below into your theme’s functions.php: add_action( ‘template_redirect’, function() { is_user_logged_in() || auth_redirect(); }); function fpw_custom_login_message() { $message=”<p style=”text-align: center”>Until this site goes public you need to be registered to see the content<br />&nbsp;</p>”; return $message; } add_filter(‘login_message’, ‘fpw_custom_login_message’);

Problem after updating plugins

There is problem with the “wordpress-seo” permission so please following steps. There are two way 1) Upload from the wp-admin Step 1 -> Change the “wordpress-seo” permission or rename the “wordpress-seo” plugin to another Step 2 -> If you have change the permission then just upgrade the plugin and if you have rename the plugin … Read more

How to rewrite URL and get the values?

The simplest and quickest solution would be to use the add_rewrite_endpoint function. <?php add_rewrite_endpoint( $name, $places ); ?> So in your case it would be something like this: add_rewrite_endpoint( ‘user’, EP_PERMALINK | EP_PAGES ); An user URL would look like this: http://www.example.com/my-page/user/john To access the variable: $user = get_query_var( ‘user’, false );

I want to filter my products with attributes [closed]

As per what I understood from your question, you want two things – Listing of all publisher Listing of all books of a particular publisher. Here is code for both. Listing of all publisher $terms = get_terms( ‘pa_publisher’ ); echo ‘<ul>’; foreach ($terms as $each_term) { echo ‘<li>’.$each_term->name.'</li>’; } echo ‘</ul>’; Listing of all books … Read more

WP::is_main_query() Not Working

Wrong hook, because what gets passed to wp is the Current WordPress environment instance not The WP_Query instance like it is e.g. passed to loop_start. You could actually just do your check inside the function callback you hook to loop_start. Edit/note: You could just have done global $wp_query; inside the wp hook, it is actually … Read more

Hook for altering the content of all wp mails

Yes, there is a filter for this. The correct filter is wp_mail and is defined in /wp-includes/pluggable.php Line 135 So the code (maybe in your functions.php) should look something like this: function mail_template($args){ ob_start(); require_once (get_template_directory() . ‘/mail-templates/contacemail.php’); $args[‘message’] = ob_get_contents(); ob_end_clean(); return $args; } add_filter(‘wp_mail’, ‘mail_template’);