Rename WP-Content folder to Hide WordPress

Rename WP-Content  folder to Hide WordPress

To do so, add this to your wp-config file, at the bottom, just before wp-settings.php are included:

define ( 'WP_CONTENT_FOLDERNAME', 'media' );
define ( 'WP_CONTENT_DIR', ABSPATH . WP_CONTENT_FOLDERNAME );
define ( 'WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/' );
define ( 'WP_CONTENT_URL', WP_SITEURL . WP_CONTENT_FOLDERNAME );

Then, simply rename your directory from wp-content to “media”

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 give space for arrow image*/
text-indent:0.01px;    /* Removes default arrow from firefox*/
text-overflow:"";     /*Removes default arrow from firefox*/}

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(); ?>&media=
<?php if(function_exists('the_post_thumbnail')) 
echo wp_get_attachment_url(get_post_thumbnail_id()); ?>&description=
<?php echo get_the_title(); ?>" count-layout="horizontal">Pin It</a>
<script type="text/javascript" 
src="https://assets.pinterest.com/js/pinit.js">
</script>

 

JFolder::create: Could not create directory

JFolder::create: Could not create directory

  1. Goto your Hosting panel >> File Manager >> Select your Domain/Sub-Domain and then open the configuration.php file.
  2. 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';
  3. Find var $tmp_path, it will also have the Directory path of your Old Server. Replace the whole line with the code var $tmp_path = './tmp';

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 different option for category. That means they can select any category that they want and if the post it to other category except that intended category by me then that will not show up in my page. So I had to force them to select a specific category. Then I found the following plugin that does it for me. Really nice one.

Click here

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 to create a new post.

This way you will be able to force a certain user to post in a certain category which is necessary in blogging.

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 )
        return $query;
    if( !current_user_can( 'manage_options' ) ) {
       global $user_ID;
       $query->set('author', $user_ID );
     }
     return $query;
}
add_filter('pre_get_posts', 'posts_for_current_author');

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 post and his profile only. But as I had contact form 7 installed there I can see that option is visible to author users also which can be devastating for your site. So I found the following solution .  To do so check out the below plugin this is really handy.

Adminimize

Create Post via email to wordpress

Create Post via email to wordpress

WordPress can be configured to enable Creating post via email. To do so you need to follow any of the bellow method

  • Use a plugin
  • Or Configure at wp dashboard

You can use any of the following plugin to enable post via email

To Configure at wordpress dashboard go to Settings >> Writing. Then fill the information there such as “Login Name” “Mail Server” etc.

After configuring that you can test it

Testing

To test your configuration, simply send an e-mail to yournewaccount@yourmaildomain (or to user@yourmaildomain if you used the .qmail forwarding setup). Then do the following:

  • If you have no automated system set up, simply view http://example.com/installdir/wp-mail.php in your browser. The script should tell you that it found an e-mail, and print details of the post it made. Then view your blog again to see your email posted.

You can find details configuration information here