Advanced

18
Mar

grunt livereload not working

I need to have live reload working otherwise i feel time is wasting with needless keystrokes. But i have killed some serious time setting it up too. Hope this post will save everyone some keystrokes. Install your modules locally with terminal in your project directory

Livereload is built into the “grunt-contrib-watch” module. Installing this module into your project root

Read more

11
Feb

get posts by array of post id’s

One way to display a selection of posts is use a foreach loop to loop over an array of id’s. The foreach loop was specially created to loop over collections such as arrays.

18
Aug

custom post type pagination using pre_get_posts

Here’s 1 function and 1 hook for custom post type pagination. Resolves the Page Not Found 404 pagination error by using pre_get_posts. Call “customLoopWithPagination” function from the archive-posttype.php template. Add the pre_get_posts action hook to your functions file Resave your permalinks from wp-admin to flush the permalink cache When you register your post type, set the rewrite url value to

Read more

26
Jun

moving wordpress and correcting the new file paths

I followed the method listed on the wordpress codex Moving WordPress and everything went smoothly. Except my images were not visible. All my images where hardcoded in using custom fields with relative urls. eg:

So the problem was the image path needed to be changed on each individual post. Changing 187 image paths manually is time intensive. I try

Read more

19
May

add custom image sizes

Add the below function and action to your functions.php file.

Creates 4 extra image sizes of each image added to your site.

Enables the display of your custom image sizes on the “insert media” screen in the Attachment Display Settings. Here’s the full code snippet

17
Apr

filter comment form

Override the output of the comment form fields and the comment form textarea. Here I have added the class of “required” to the name field, email field and the comment box textarea. Two filters are needed to do this.

Hook is used to override the form fields

Hook is used to override the comment form text box

Read more

17
Feb

add extra column to mySql table

i added new column group id to the table wp_enewsletter_members

22
Jan

Testing email newsletter designs and technical checklist

Thunderbird provides a way to embed your email newsletter design into the email and send it out for testing purposes. Install the stationary addon Download the stationary addon. From within thunderbird. Go to tools > Addons. From the options menu (near search box) > Install addon from file. Embed the html Go to Tools > Stationary options. Select > add

Read more

10
May

WordPress and Sass / Compass stylesheets

Create your compass project

This gives you

Create or move the config.rb file to the root of your theme dir. Edit as follows.

4
Apr

ftp files with terminal Mac OSX

1. Connect to server Get terminal into ftp mode by typing

Connect to your server

Username

Password Type or paste-in your ftp password. The password will be invisible. Press Enter. 2. Select destination folder on server Print your current location on the server using

Ftp terminal will probably respond with “Remote Directory: /” Which means you

Read more