Logged in only custom page

You can redirect non logged in users to login page using following code if they access custom.php page link. Create custom_login.php as custom template and assign it a page, in the code below i have assigned it to a page “login page” having slug “login-page” function redirect_to_login(){ if( ! is_user_logged_in() && is_page_template(‘custom.php’) ){ wp_redirect( home_url() … Read more

customize footer widgets area

CSS is a better way to go. Use a different class for the first two widgets than those that follow, so you can position them each where you want them. Float, width, and possibly min / max-width should be all you need to get this working. If every widget is floating left, and the first … Read more

Remove Twenty Twelve themes responsiveness in Internet Explorer

Create a child theme of TwentyTwelve. Copy the header.php to your child theme directory. Modify it to add conditional comments to load an “Internet Exlorer” only version of you stylesheet. Use TwentyTwelve’s style.css as a starting point to create your IE only CSS file, or just override the responsive bits that you don’t like.

How to strip thumb from widget

You should remove this part: <?php if ( (function_exists(‘has_post_thumbnail’)) && (has_post_thumbnail()) ) { ?> <div class=”widget-img”> <a href=”https://wordpress.stackexchange.com/questions/116533/<?php the_permalink(); ?>” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_post_thumbnail(‘lists’); ?></a> </div><!–widget-img–> <?php } ?> . Just to explain… This conditional statement askes… if there is a thumbnail run the code in between me and my closing tag… <?php if … Read more

How to delete orphan userdata from array in wp-options

If what posted is all the code you are using, you unsetting the value from the retreved array using unset, but then you don’t save again the array on database: add_action( ‘delete_user’, ‘forum_remove_deleted_user’ ); function forum_remove_deleted_user($user_id) { $user_obj = get_userdata($user_id); $subscbr_email = $user_obj->user_email; if( ! empty( $subscbr_email ) ) { $list = (array) get_option(‘mf_forum_subscribers_1’); if( … Read more

Search a meta field for a value in all posts

WP_Query will return a WP_Query object. An object will never match the string $ip that you are comparing it to. What you need to be doing is checking whether results were returned, which you can do by checking the found_posts property: $ip = $_SERVER[‘REMOTE_ADDR’]; $query = new WP_Query( array( ‘ignore_sticky_posts’ => true, ‘meta_key’ => ‘voted_IP’, … Read more

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