Category » Wordpress

Child theme stylesheet loading before the parent theme stylesheet

Wordpress

I was creating a child theme for a wordpress theme. I created style.css file in child theme which overrided some of the parent theme styles and a functions.php file which included the parent style.css as below:

<?php
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
?>

Now when I activated the child theme from Wordpress admin, changes in the child theme were not reflecting. I checked the browser source code and found that the child style.css was included before the parent style.css.

Continue reading »

Create a new admin account in WordPress via FTP

Wordpress

If your Wordpress admin account get locked then you can try to restore admin account access by using the “Lost your password?” link on the admin login page or you can try to reset your password by directly updating it in database.

There is one more way if you have FTP access to your Wordpress installation folder. Guess How? By creating a new admin account.

Continue reading »

How to change the “Reply” text in the comments listing and add a custom css class to the “Reply” link?

Wordpress

If you open the comments.php template file and look at the source code you will find that “wp_list_comments” function is used to display the comments listing. To change the “Reply” text your can pass “reply_text” parameter to “wp_list_comments” function.

Similarly to customize the comments listing frontend design you can pass a callback function as parameter to “wp_list_comments” function.

Continue reading »

How to Add a Smooth Scroll to Top Effect in WordPress using jQuery

Wordpress

We had discussed “How to Add Smooth Page Scroll to Top using jQuery” in one of our previous posts. Now lets see how to implement the same in Wordpress.

Step 1: Paste the below HTML any where in your theme’s footer.php file.

<a href="#" id="scrolltotop" title="Back to top">Back to top</a>

Continue reading »

What are WordPress Post Formats, why & how to use them?

Wordpress

Post Formats is a theme feature introduced in Wordpress with version 3.1, means it will only be available if your theme supports it. A post format is a meta information that can be used by themes to categorize the posts to present them differently.

Continue reading »

Debugging in WordPress

wp-config.php

Any code developed for the first time is not 100% bug free. While working on a Wordpress based website or any other technology website it becomes easy to fix the bugs/issues if they are pointed out by the system.

“wp-config.php”  file located at the root of wordpress folder provides settings that enable the “Debugging” mode in wordpress.

Continue reading »

Disable Post Revisions in WordPress

revisions

Wordpress provides a very good feature of maintaining post/page revisions. By default this feature is enabled so wordpress will save copies of each edit made to a post or page; this provides us a provision to revert to a previous version of that post/page.

While you website is in development mode, you may want to disable the “Post Revisions” feature. Also website owners with limited database space may want to disable this feature or limit the number revisions saved.

Lets see the related settings to be made in the configuration file “wp-config.php” located in your WordPress root directory.

Continue reading »

SEO Ultimate version 7.6.1 syntax error on installation

I downloaded SEO Utlimate Version 7.6.1 [http://wordpress.org/extend/plugins/seo-ultimate/] wordpress plugin for my blog site. I unzipped the downloaded file and uploaded the extracted folder to /wp-content/plugins/. When I activated the plugin from admin I got the following error:

Parse error: syntax error, unexpected T_IF in /home/xxx/public_html/wp-content/plugins/seo-ultimate/modules/author-links/author-links.php on line 1

Continue reading »

Excluding Pages from wordpress search results

By deafult Wordpress search feature displays pages as well as posts in the search results. It may be desirable that you want to display only posts for the search results in your blog. Here how you can do this.

Create the function below and add it to your theme functions.php file.

function SearchResultsFilter($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}

add_filter('pre_get_posts','SearchResultsFilter');

Continue reading »

Excerpt/Discussion box not visible

You  try to add a new post and want to add a manually crafted excerpt but you do not see the excerpt box, there is no need to worry.  On the Add new post screen click on the “Screen Options” link at the top right side besides the “Help” link below the welcome greeting.

Continue reading »

Back to top