How to force login for visitors in wordpress ? To make it happen just add the below code to your theme header // Require login for site get_currentuserinfo(); global $user_ID; if ($user_ID == ”) { header(‘Location: /wp-login.php’); exit(); } Also you can change the location to any url you want
Author Archives: Amanur Rahman
How to change the default dropdpwn arrow using only CSS
How to change the default dropdpwn arrow using only CSS To Do so just add the following code to default select option class -webkit-appearance: none; /*Removes default chrome and safari style*/ -moz-appearance: none; /* Removes Default Firefox style*/ background: url(‘dropdown_arrow.png’)no-repeat; /*Adds background-image*/ background-position:82px 7px; /*Position of the background-image*/ width:100px; /*Width of select dropdown to …
Continue reading “How to change the default dropdpwn arrow using only CSS”
How to add a print Button to your post
How to add a print Button to your post Just add the bellow code to your wordpress loop <a href=”javascript:window.print()”>Print</a> Or Alternately can use this code also like below <input type=”button” onClick=”window.print()” value=”Print This Page”/> This is so simple
How to add pinterest pin it to website
How to add pinterest pin it to website Clean Pin it link <a href=”http://pinterest.com/pin/create/button/” count-layout=”none”> <img src=”//assets.pinterest.com/images/PinExt.png” alt=”Pin it” / > </a> <script type=”text/javascript” src=”https://assets.pinterest.com/js/pinit.js”> </script> For static website the link should be as follows <a href=”http://pinterest.com/pin/create/button/” count-layout=”none”> <img src=”//assets.pinterest.com/images/PinExt.png” alt=”Pin it” / > </a> <script type=”text/javascript” src=”https://assets.pinterest.com/js/pinit.js”> </script> For WordPress <a href=”http://pinterest.com/pin/create/button/?url= <?php the_permalink(); …
JFolder::create: Could not create directory
JFolder::create: Could not create directory Goto your Hosting panel >> File Manager >> Select your Domain/Sub-Domain and then open the configuration.php file. Find var $log_path, it will contain the Directory path of your Old Server. Just replace the whole line with the code var $log_path = ‘./logs’; Find var $tmp_path, it will also have the …
Continue reading “JFolder::create: Could not create directory”
How to force a user group to post in a certain category ?
Today I have tried to restrict a user group to post in a specific category. The idea was that I was going to create a page where a specific category post needs to show. Then I created a loop for a specific category to show in that page. But the problem was that users have …
Continue reading “How to force a user group to post in a certain category ?”
Force user to create post only in specific category
To do so you need to install the following plugin below http://wordpress.org/extend/plugins/role-scoper/ Then first, you have to go into Category Restrictions and restrict all categories for an entire role (in my case, Post Author), then go into Category Roles, select a specific user and select the category in which you want to give them permission …
Continue reading “Force user to create post only in specific category”
Restrict a user to view other post except he created
To restrict a specific user to view other post except he created need to add the below code to your theme function file. Put the below code to function.php and you are done. function posts_for_current_author($query) { global $pagenow; if( ‘edit.php’ != $pagenow || !$query->is_admin ) …
Continue reading “Restrict a user to view other post except he created”
Restrict other users to see the contact form 7 option at dashboard
Restrict other users to see the contact form 7 option at dashboard Today I have faced a new problem. I was asked by my clients to be able to set registered user just post. Then I set the default registered user role as author about which I know that he or she can be manage …
Continue reading “Restrict other users to see the contact form 7 option at dashboard”