Displaying a widget in sidebar only when no other widgets rendered?

I not 100% clear what your question is so hopefully this can point you in the right direction for conditional widgets. I will give you 3 options. 1. is_active_widget checks if widgets are active based in the widget ID. http://codex.wordpress.org/Function_Reference/is_active_widget 2. Using is_active_sidebar and creating more sidebars usually gives you better control over widget output. … Read more

How to not show post_thumbnail from specific category for not logged users

You can hook a filter to the post_thumbnail_html and check if its a post in that category and if the user is not logged in ex: add_filter( ‘post_thumbnail_html’, ‘my_post_image_html_wpa92119’, 10, 3 ); function my_post_image_html_wpa92119( $html, $post_id, $post_image_id ) { $category_to_exclude = “CHANGE_WITH_CATEGORY ID”; $logIn_Img_path = “CHANGE THIS WITH PATH/TO/NON-LOGGED/USERS/IMAGE”; //check if the post have that … Read more

One custom loop with condition to check child posts

The appropriately named get_children() should be what you want. if ( have_posts() ) { while ( $loop->have_posts() ) { $loop->the_post(); $args = array( ‘post_parent’ => get_the_ID(), // the ID from your loop ‘post_type’ => ‘page’, ‘posts_per_page’ => 1, // you only need to know if you have children so one is enough ‘post_status’ => ‘publish’ … Read more

Personalized message for each unique password-protected page

You should probably add in more checks, but this should get you started. function change_pw_text($content) { // Just to save processing other pages. if ( !is_page(‘page-slug-one’) && !is_page(‘page-slug-two’) ) return $content; $find = ‘This post is password protected. To view it please enter your password below:’; if ( is_page(‘page-slug-one’) ) $replace=”Hint: Tell our system to … Read more

Redirect to a different page through registration, depending on page

Changing the function to the following works, as it checks to see if the form was submitted from the correct page: function my_foo_registration_redirect( $redirect_to) { if ($_SERVER[‘HTTP_REFERER’] !== get_the_permalink(1693)) { return $redirect_to; } $redirect_to = ‘/videoguide-startpakke’; return $redirect_to; } Thanks a lot for the super helpful comments! EDIT: Here’s a slightly more polished solution function … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)