Get Image Src With PHP

There are some occasions where you need to get the attribute value in PHP from a HTML element, this can be for migration reasons or perhaps you are writing a script to scrap a website to store the values found. I was writing a script that needed to scrape a web page and pick up all the URLs for the images on the page and store the src values. You

Read more...

Remove Query String From Stylesheets In WordPress

A website owner should always be trying to improve the speed of their website as much as possible. In WordPress there are many things you can do to help improve the performance of your website. Tips to improve the performance of your WordPress website When you run your website through speed tests such as Google Page Speed test one of the things they will flag up is the loading static

Read more...

File_Exists For Remote URL

If you want to make sure that a file exists in PHP you can use the function file_exists(), which takes one parameter of the filename. This function will not only work for files but will also work for directories, you can pass in a filename of the directory and if this directory exists the file_exists() function will return true. The problem I've seen with this function is that people have

Read more...

Getting Started With SASS

If you do any front-end development over the past couple of years then you would of heard of CSS pre-processors. The most common CSS pre-processors are SASS, LESS, or Stylus. CSS pre-processors are scripts that will compile code and output the results into CSS stylesheets. They allow you to create more dynamic, optimized and organised CSS for your websites. In this article I am going to investigate what it is

Read more...

Sticky Posts In WordPress

As of WordPress version 2.7 you've been able to assign some posts to be sticky, a sticky post will make sure that this post appears at the top of the list of posts. If you use your WordPress site as a normal blog and have a list of posts of the homepage of your site, making a post sticky will ensure that this post appears at the top of the

Read more...

Update Row With Highest ID In MySQL

Recently needed to update the last inserted row of a table but didn't have anyway in knowing what the highest ID in the table was. I can easily do this by using the max() function to select the highest ID in the table. Then I can use the result of this query in the UPDATE query to edit the record with the highest ID. But this is quite a easy

Read more...

Share Multisite Media Libraries

When you use WordPress multisite functionality you are creating a brand new site for each site in the network. This means that they will use different content, different menus and different widgets. They can re-use the same plugins and themes as each other but they are treated as completely different sites. While doing client work with WordPress multisite I've noticed that most sites want to kept separate but because they

Read more...

Redirect Users After Login In WordPress

WordPress comes with the ability to create different users for your website. Each of these users can have different roles and different capabilities to perform tasks on your website. You can have users which are allowed full control over everything on your site, install plugins, install theme, edit posts, upload media, everything. At the other end you can have users that are only allowed to view the posts on your

Read more...

Equal Height Columns

If you are displaying a number of columns on your web page then would of probably reached the problem where you need these columns to be the same height as each other. The problem you have with these is when you have different content in the columns some will be larger than others, which will break the design of the website. When you start adding content to these boxes they

Read more...

Add Custom User Profile Fields In WordPress

When you are working on projects that need a lot of user management then you can get to the point where you need to add additional information to the users of your website. This is similar to creating new post meta data where you are able to create new bits of data and attach them to your posts, the users can work in exactly the same way. In the WordPress

Read more...

1 2 3 4 5 6 7 8 9 10 11 12 13 67