Tips & Tutorials

Working together with MooTools & jQuery: Revisited

Friday, November 27th, 2009

Approximately a year ago, while I was starting to work with WordPress and trying out different plugins, I had encountered problems trying to integrate plugins that used MooTools and plugins that use jQuery. I had posted a possible solution in there as well. Here are solutions from jQuery site, if you want to know more.

So, after a year with playing around a lot of plugins that uses mootools / scriptaculous and other plugins that uses jQuery (which I prefer), I want to share one easy solution that I have found. I haven’t had any problems till now with this solution and I have been using and recommending to to all my themes.

You do not have to define and noConflict function as recommended by jQuery site. Simply, refrain from using $ as a shortcut to jQuery which means that you have to use jQuery in place of all $ used by your jQuery code. So, your code will look something like this:

jQuery(document).ready(function(){
   jQuery("div").hide();
});

I know its a bit tedious but it works well without having to take all the headaches of what is happening. So, while your jQuery plugin work perfectly, you can enjoy the features from other plugins using MooTools or other libraries.

Happy Thanksgiving to all. Once again, I would like to personally thank everyone for being a part of WPshoppe.

:o

Enabling Comments in Pages in WordPress

Thursday, November 19th, 2009

I have been working with WordPress themes for more than a year now and while most of the time, I am only using the default theme and changing the codes and styles as I want, one question has been circling my mind all this time. How do I enable comments in pages and not just posts?

First, I thought it was not possible. I have been getting quite many pingbacks and trackbacks on pages too but even though I approve them from my admin area, I don’t see anything on the page when I visit it. I never thought twice of what might be the cause. I always thought, well its not possible in pages.

Anyway, I just got a question from Kurt about this and a few times earlier. I never looked at the possibility but had this in mind, maybe the page doesn’t have comment template function call. I didn’t look at the code fully. Page.php was always what it was.

So, I just had some time and looked at page.php. Indeed, this was pretty simple. I compared with single.php and I didn’t see comment template call on page.php. I did a quick testing by putting this code:

<?php comments_template(); ?>

and saw the the page. Voila, there it was!

So, if anyone else is having this very problem of “how to enable comments on pages”, here is what you have to do. Put this code

<?php comments_template(); ?>

right before your closing content div. So, the code might look something like this:

<?php get_header(); ?>

<div id="content">
<?php // all page content goes here ?>
<?php comments_template(); ?>
</div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>

I would love to know if you have any other ideas about how to enable comments on pages. This might not be so important since Pages aren’t there for commenting in the first place. I guess thats why the default themes (or most) doesn’t have this enabled.

Learning jQuery

Wednesday, April 29th, 2009

Oh.. Its been a long time since I posted. Nothing much going on. Been busy most of the time. I have been trying to come up with a new photography theme for Graph Paper Press. Apart from that I am doing a little jQuery. It had been a long time I looked at tutorials and today I just found the jQuery for Designers site totally revamped. I used to surf the site before but it had an old look. I was kind of excited and surprised at how stunning the new design is. Now that makes me do some more jQuery. :)

Check that site out if you are also learning jQuery!

WordPress Care #1

Tuesday, December 30th, 2008

careFirst thing that I came to know of while working with WordPress. I will probably encounter a few more later as I continue working on it. You can share yours! :)

(more…)

Working together with jQuery and MooTools

Wednesday, December 24th, 2008

jQuery and mootoolsIf you are also stuck with JavaScript framework wars and are in trouble trying to make it work together, here is a good tip. I recently was working with a WordPress Theme for a client and had to build a plugin. I have been a fan of jQuery and immediately started using it to create the small plugin for the site. It worked great!

(more…)

Child Themes for WordPress

Thursday, December 18th, 2008

Every heard of Child Themes? This is a very less discussed term in the WordPress Theme Development world. But this is nothing too complex. It is very similar to how to develop normal WordPress themes. So, you just have to create a folder name (such as simpleX Child) inside the themes folder and add a style.css in it. The style.css should include the following (at the least):

(more…)

Removing the Fugly Search Bar on YouTube embeds

Tuesday, December 9th, 2008

All of a sudden you see the fugly search bar on every YouTube video embeds. Though it is now made optional due a lot of negative responses over the web about the newly added feature. There is an explanation to why it added the search bar here. But who and why on earth was it approved? Every one was wondering if it was due to a virus.

(more…)

Adding rel=”nofollow” to WP functions

Friday, December 5th, 2008

Recently, one of my clients requested me add a rel=”nofollow” argument in the about page of his site. WordPress by default only adds that to its comments section to prevent spam marketing. There might be various ways doing so but I found it pretty difficult to find a good solution in this case. Why? Because the page list wasn’t being called directly using wp_list_pages(). It used a custom function. Not only that, due to some customization to the function, it also used a php variable in the parameter.

(more…)

Ever landed on a 404 Error Page after upgrading?

Thursday, December 4th, 2008

I recently upgraded wpshoppe.com from 2.6.3 to 2.6.5. At first, it was working fine and I did make 2 posts after the upgrade. I thought it was successfully upgraded but 2 days after that when I tried to login to wp-admin it was redirecting to 404 Error Page. I am not sure how that actually happened but I searched over the net and found few answers.

(more…)

WordPress’d @ 2.6.5

Sunday, November 30th, 2008

There was a security update on the newly released WordPress version 2.6.5 and I might have been late in upgrading it to this version. Usually, you will need to upgrade your WordPress if you do not want some other person hacking into your site. So, why not do it now?

(more…)