Wordpress SEO Expert

Rank higher in Google organic search with 24 year experienced SEO professional Peter WM.

  • SEO Overhaul
  • SEO Campaign
  • WP Support
  • Blog
    • SEO Emails
  • Praise

Quick dirty PHP redirect

February 9, 2016 by Peter WM

For when you need to do it and just do it quickly.

<?php header('Location:http://www.yoursite.com/new_page.html'); ?>

Filed Under: Nerd-stream, Uncategorized Tagged With: code, code snippets, PHP

Show all images in a directory using PHP

March 1, 2013 by Peter WM

This is a sweet script. It displays all the files in a particular directory. In this case it’s a folder full of user uploads, so it makes keeping an eye on things a breeze.

[sourcecode language=”php”]‘;
}
?>[/sourcecode]

You can of course easily modify it to show only JPGs or other image types (if you’re pulling content from a directory of mixed file types) or to edit the echo so it returns images that link to user profiles etc.

But this is it’s most basic form.

Filed Under: Nerd-stream, Uncategorized Tagged With: directory, display, folder, glob(), images, PHP

Website code template

February 13, 2013 by Peter WM

This is for my fellow developers out there.

I have a small series of files I copy and paste whenever I’m about to start a new project, they have default templates for various files I use a lot. Like a header, footer, index page, blank stylesheet, and something called “top.php” that I use to open sessions and connect to databases.

There are also some of my standard folders pre-made too (with the correct server permissions) like “img” (images) and “upl” (uploads).

This was going to be last week’s #fridayfreebie, but here it is on a Wednesday instead.

This particular version is the one I use most commonly, and it’s set up for:

  • PHP
  • MySQL
  • HTML5
  • CSS (any version!)
  • and ideally a unix/linux based server, because it references the top level of the site as being “/”.

I’ve zipped it up to share! Feel free to do whatever you want with it—although there is a lot of Peter WM specific stuff in there, so you might want to take that out. Unless of course you like giving me credit for your work. 🙂

HTML5 website template (.zip)

Filed Under: Code, Freebies, Nerd-stream Tagged With: #fridayfreebie, CSS, files, footer, header, html5, mysql, PHP, template, top.php, website template

Create custom RSS feeds in WordPress

August 31, 2012 by Peter WM

I couldn’t quite work out how best to do create a custom RSS feed in WordPress.

My task seemed simple enough, to make an RSS feed of news articles from popular news sources…but the RSS feed needed to link back to the original source, NOT the article in WordPress.

Writing the PHP script to generate the RSS was simple, but the final step was getting WordPress to serve that feed.

Here’s the documentation I used, in addition to a custom field:

Create custom RSS feeds in WordPress | Tips4PHP.

Filed Under: Code, Nerd-stream Tagged With: documentation, feeds, PHP, rss, wordpress

Get FREE Wordpress SEO tips!

I send regular newsletters with WordPress SEO expert-level tips. Sign up to get them, along with my FREE e-book “Ongoing SEO Success”.

Did I mention they’re free!

Subscribe for free

Praise

I have over 2000 5-star feedback reviews (and I’ve never received less than the full five.)

Here’s just one example, from Mike who runs Costello Entertainments:

Migration, Hosting, SEO and Speed Work on our new website all completed quickly and efficiently and Peter was most helpful in fixing an issue with a Popover on the site as well. If you’re thinking about asking Peter to do a job for you or hesitating, JUST DO IT! – He knows programming and the internet inside out, he’ll get the job done for you professionally, with a smile. I wish I could call a plumber or a tradesman to do the jobs I can’t do myself with the same level of confidence.
Read a lot more.

Recent Blogs

  • Don’t just search for yourself!
    This is actually a stock answer I send people pretty often. I’m regularly asked about the difference ...
  • SEO doesn’t shouldn’t your site’s front-end
    On my SEO Emails section (where I share helpful responses to commonly asked queries) I recently shared a not ...
  • Cumulative Layout Shift (CLS) for SEO & Speed
    Right, this is an interesting one. It’s technical, but has a very simple main recommendation (in large ...
  • Large Google Algorithm Update
    We’ve seen another core update from Google to their algorithm. They usually make updates of this size a ...

Legal

  • Terms and conditions
  • Privacy policy
  • Disclaimer

Also read

  • Payment information

RSS

Peter WM, WordPress SEO expert blog

Recent Posts

  • Don’t just search for yourself!
  • SEO doesn’t shouldn’t your site’s front-end
  • Cumulative Layout Shift (CLS) for SEO & Speed
  • Large Google Algorithm Update
  • Case Study: Turning SEO work off

© Copyright 2022 Wordpress SEO Expert · All Rights Reserved · Site by Peter WM