Philip Newcomer

The Backwoods Coder

Skip to content
  • Home
  • WordPress Plugins
    • Author Post Ratings
    • Customizer Framework
    • Responsive Image Maps
    • Show Hidden Post Meta
    • Widget Output Filters
    • WP Stripe Email Receipts
  • Contact

php

Post navigation

WordPress Ajax Helper Library Released

Posted by Philip Newcomer

0

I’ve just released a new PHP library for simplifying Ajax requests in WordPress plugins and themes. It’s called WP Ajax Helper, and you can find it on GitHub and Packagist.
Continue reading →

Posted in News, PHP, Releases, WordPress

Tagged ajax, javascript, jQuery, json, library, php, WordPress

Dec·31

Get the Attachment ID from an Image URL in WordPress

Posted by Philip Newcomer

51

I recently needed a way to get the ID of a WordPress image attachment, but I only had the image URL to work with. The problem was complicated by the fact that the image URL could be a thumbnail of the original image attachment, i.e. one of the auto-generated post thumbnail image sizes. Continue reading →

Posted in Theme Development, Tips, WordPress

Tagged images, php, thumbnails

Nov·07

Add Post Categories to the Body Class in WordPress

Posted by Philip Newcomer

10

Sometimes you may find yourself needing to style a particular post differently, based on the category that it’s in. Here’s a little function that will add each of a post’s categories to the body class of the single post page (assuming your theme uses the body_class template tag):
Continue reading →

Posted in Theme Development, Tutorials, WordPress

Tagged php, template tag

Oct·18

Post navigation

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Most Popular Content

  • How to Target Internet Explorer 10 and 11 in CSS
  • How to Filter the Output of any WordPress Widget
  • How to Delete all WordPress-generated Thumbnail Sizes
  • Get the Attachment ID from an Image URL in WordPress
  • How to Allow REST API Requests While Restricted Site Access is Active
  • Creating Custom RSS Feeds in WordPress - The Right Way
  • Add Post Categories to the Body Class in WordPress
  • Human-friendly Time Ago PHP Function
Tweets by @BackwoodsCoder

Recent Comments

  • rishi on How to Target Internet Explorer 10 and 11 in CSS
  • rishi on How to Target Internet Explorer 10 and 11 in CSS
  • Pascal on How to Delete all WordPress-generated Thumbnail Sizes
  • Milan Patel on How to Target Internet Explorer 10 and 11 in CSS
  • Jonathan on How to Target Internet Explorer 10 and 11 in CSS

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Proudly powered by WordPress | Theme: Reddle by WordPress.com.