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.

http://wordpress.org/plugins/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

Responsive layout using page media

Responsive layout using page media

Today I am going to show you how to make website responsive using page media. For doing so you need to understand the screens width of  different device like mobile,Tab, Etc. Below is the table of content which specifies various screen width of various devices.

/* Table of Contents
==================================================
#Mobile – 240px
#Mobile – 320px
#Mobile – 480px
#Tablet – 768px
*/
/* #Mobile – 240px

================================================== */
@media only screen and (min-width: 320px) and (max-width: 479px) {
.aman{
width:300px;
height:50px;
background:yellow;
}
}
/* #Mobile – 480px
================================================== */
@media only screen and (min-width: 480px) and (max-width: 767px) {
.aman{
width:460px;
height:50px;
background:blue;
}
}
/* #Tablet – 768px
================================================== */
@media only screen and (min-width: 768px) and (max-width: 1023px) {
.aman {
width:748px;
height:50px;
background:red;
}
}
/* #Screens Bigger than – 1280px
================================================== */
@media only screen and (min-width: 1281px) {
.aman {
width:970px;
height:50px;
background:#ccc;
}
}

 

Now adjust your CSS into those area according to your need. You can use firebug for firefox to navigate element and set there properties according to devices.

That’s it. It’s too easy but sometimes it may take time to adjust various devices.