Working on a new project and the client wanted to show a different number of posts displayed on the first page of posts, than on the rest. In order to enable promoted cards to be given more prominence on the first page. Continue reading “Developer // WordPress Query For Showing Different Number of Posts on Different Pages”
String Find and Replace in MySQL
When creating resource links to assets in our CMS a couple of users had inadvertently linked to the ‘._Filename.doc’ file created by OSX, instead of the intended ‘Filename.doc – on just under 300 files.
Running a quick query to return all the affected resources I used the REPLACE funtion in MYSQL to set all the asset values again (minus the ‘._’)
update TABLENAME
set value = REPLACE(value, '/._', '/')
where value like '%/._%'