Tag Archives | wordpress

Limit WordPress Search To Post Titles

In this article, you will see how to limit your wordpress search to post titles only. WordPress version WordPress 3.5 Source Code $search .= “{$searchand}(($wpdb -> posts.post_title LIKE ‘{$n}{$term}{$n}’) OR ($wpdb -> posts.post_content LIKE ‘{$n}{$term}{$n}’))”; Remove the OR part (in bold) to make it specific to post title.$search .= “{$searchand}(($wpdb->posts.post_title LIKE ‘{$n}{$term}{$n}’))”; Source File Source [...]

Continue Reading ... Comments { 0 }

Next and Previous Links for same Category in WordPress

I created a category and call it “WordPress”. Then I created some posts and assign “WordPress” as category for the posts. Now I want the next/previous to be shown for the same category only. WordPress version WordPress 3.5 Arguments function previous_post_link($format=’« %link’, $link=’%title’, $in_same_cat = false, $excluded_categories = ”) You can change the in_same_cat to [...]

Continue Reading ... Comments { 0 }

JQuery not working in WordPress

Exception The jQuery is not working in WordPress and you are getting the error as shown in Figure 2.1 Figure 2.1 Solution Use jQuery instead of $ as shown in following code

Continue Reading ... Comments { 0 }

Adding JavaScript to WordPress Posts Without a Plugin

Sometimes you may want to include some javascript into your post, but you are screwed up with the Syntax Error as shown in Figure 1.1 Figure 1.1 Then you start searching for “JavaScript in WordPress Posts” or so, but you can embed javascript into your wordpress posts without any plugin. Just follow these steps :

Continue Reading ... Comments { 0 }