Back To Top WordPress Plugin

In a previous tutorial I wrote about how you can use jQuery to create a Scroll back to top button. jQuery Back To Top In this tutorial we are going to create a WordPress plugin that adds scroll back to top link to your website. You will learn how to create the plugin to handle this and settings to change the position of the link and text on the link.

Read more...

Free Files For February 2016

Each month the Envato marketplace brings you free premium files, here's the first free files for February 2016. Envato is a web marketplace where you can get premium files for different areas of your website. My favourite marketplaces are the script marketplace CodeCanyon and the theme marketplace ThemeForest. Here are the files which you can get for free for February 2016. Airy - Photography & Creative HTML Template 80 purchases

Read more...

Get A WordPress Plugin File Path Or URL

In this code snippet we are going to look into how you get a full path of a plugin file. When you are developing a plugin you can store multiple file types in it such as CSS or JS files where you need to access the full URL for the file, or you could have another PHP file which you want to include by calling the full directory path. As

Read more...

Return Class Constant From Variable

PHP constant values allow you to set a variable on the class which will remain the same and is unchangeable. The difference between these constants and other variables in a class is that they are not defined with a $. In a recent project I had a situation where I needed to get the value of a class constant, normally this isn't a problem you would just use the ::

Read more...

jQuery .html() Get Containing Element

Whenever you need to get all the contents of a HTML element in jQuery you can use a handy function .html(). See the demo above for a demo of how to use the html() function. This will populate the contents variable with the contents of the .content div. The problem I was having on a recent project is I needed to get the content of the HTML of a element

Read more...

Free Files For January 2016

Each month the Envato marketplace brings you free premium files, here's the first free files for January 2016. Envato is a web marketplace where you can get premium files for different areas of your website. My favourite marketplaces are the script marketplace CodeCanyon and the theme marketplace ThemeForest. Here are the files which you can get for free for January 2016. Passworx Password Locker 66 purchases at the price of

Read more...

Stop WordPress Automatically Adding br

WordPress uses a function called wpautop to automatically add paragraphs and line breaks to your content from the content editor. This will change double line breaks and convert them into a HTML paragraph. This takes two parameters the first being the text that needs to be converted, the second being a boolean value, defaults to true which will take line breaks and convert these to line breaks. There are certain

Read more...

WordPress Recent Posts Shortcode

On WordPress.com you automatically get are a large number of shortcodes that you can use on your blog. Here you can view all the default shortcodes on WordPress.com. One of these shortcodes is to display the most recent posts by using the shortcode display posts. The below is a code snippet you can use to add a list of the most recent posts and the date they were published. This

Read more...

Preserve Variables Between Unit Tests

Although not strictly unit testing but more functional testing I've been in the situation where I've had to perform automated tests of database interactions. This could be by using a process of creating a record, getting the record and then deleting the record creating self clean up unit tests. The above scenario is always a problem in automated tests because you need to make sure that you are getting the

Read more...

Set WordPress Posts To Private By Default

The following code snippet will allow you to set all your posts to private as default. We do this by using the action post_submitbox_misc_actions and inserting jQuery into the page to change the selected visibility setting. First this will check to see what the current post status is. If the post status is publish then we can set the visibility status to publish. Then we check to see if the

Read more...

1 2 3 4 5 6 7 8 9 74
Back to top ^
X

Search