Category: Wordpress
-
WordPress Security – Data validation and sanitization
Lets talk a bit about validation and sanitization needed for wordpress themes and plugins. WordPress security is very often overlooked by many wordpress plugin and theme developers. Imagine your plugin runs unsafe in millions of websites. It has been said over thousand times “Never trust user input” but have you implemented the security measures? Before…
-
WordPress – How to add theme options sylesheet in admin area?
Adding a style sheet to your backend theme options page is easy and can be done with just a few lines of code. This code will only work in your theme options and not the whole wordpress admin area. The key here is use to use admin_enqueue_script() to add the stylesheet. To get this code…
-
WordPress – How to add reset button in theme options page?
I was working on a wordpress theme project, where i implemented theme options page. Thought that there needs to be a feature to reset all theme values, when a button is clicked. It didn’t work, when i put-up a Reset button, near the submit button on the same form in the wordpress. It turns out…
-
Softlights – Free wordpress theme with unlimited colors
Softlights is a fully customizable wordpress theme with unlimited colors through color picker, ideal for content hungry websites. It is simple, easy to use theme and doesnt dazzle you with setting hundreds of theme options. Pick the colors you want for header, background, footer, widgets, showcase box and go live within a minute. The theme…
-
WordPress – How to save default values in theme options page?
If you are a wordpress plugin or theme developer, when creating a theme options page, have you ever wondered why you get Notice: undefined index warnings, thrown by the wordpress debugger. This because when you activate the theme, there is absolutely no values initialized (not even empty values). I am assuming that you are storing…
-
WordPress – How to remove the dots in excerpt endings?
By default wordpress, automatically adds the […] to while clipping the excerpt extra data. This you will notice in the homepage when the blog posts show up. Personally, i dont like this and i always fix this by replacing [..] to something like either remove it or with couple of dots. Here is the snippet…
-
How to replace strings or tags inside content in WordPress?
With wordpress is pretty easy to filter and replace tags that occur inside the content. Lets say you have the content with <php> tags and want to replace it as <pre> tag. All you need to do is write a filter in your theme file <strong>function.php</strong> ,that finds and replaces all occurrences of php tags, which is so…
-
How to include php files in wordpress?
Any good theme or plugin developer would break the theme files into small ones and then included them as and when needed. This way you you save yourself from the cumbersome job of editing each and every php file. But, how you do you include the php file, the correct way in wordpress. If you…
-
How to add jquery to WordPress theme?
WordPress uses jquery by default and you dont have you do anything extra, most jquery scripts and plugins should pretty much work well by default. so, how to add jquery the correct way? Its easy and can be done with just 3 lines of code and can be done in a couple of ways.Go to…
-
How to list posts for every category in WordPress
If you are building a news site or a directory based theme, you might like to print all categories and then output 10 recent posts in every category, through the use of the loop. Here is the snippet of the wordpress code, that does that. Basically its a double loop, first loops through all categories,…