I’ve started a PHP tutorial series on YouTube. You can check out the first video in the series here.
Ping Google/Bing/Ask with Your Sitemap – PHP
Google, Bing, Ask.com, and Yahoo (they stopped their ping service) all have services where you can send the url of your sitemap in a http request and get it added to the crawl queue. You can automate this process by using this PHP function, which will ping all 3 given your sitemaps’ urls. Here’s the function (it’s kind of long so I’m putting it after the jump):
Continue reading »
WordPress 3.4 Proposed Guidelines
The new proposed guidelines for themes under WordPress 3.4 are open for discussion, if you’d like to make your opinions known.
New WordPress Theme – Magomra
You may have noticed that this site’s theme has changed recently, it is a theme of my own design called Magomra that I’m in the process of getting added to the theme repo so everyone can enjoy it.
If you have any suggestions, or if anything is rendering wonky, please leave me a comment (no login needed).
Patent Bar Exam Stuff
I’m taking the patent bar and I figured I’d write up my study stuff here instead of some text editor where it will be lost forever. So forgive the flood of dry, legal, patent posts for the next few weeks, (on second thought, I think I’ll keep it all in one multipage, megapost for now. On third thought, this would go a lot smoother (formatting and interlinking wise) on the wiki.)
And if you’re a prospective USPTO exam taker, I hope you find some of this helpful! Feedback on my misunderstandings would be more appreciated than ever!
MediaWiki is Live
I’ve got the MediaWiki up and running. I’ll be using it most for man pages for my plugins/themes since WordPress isn’t actually very well suited for that kind of stuff.
Forcing W3C Compliance on WordPress… Elegantly
WordPress is generally pretty compliant, but there’s a couple sticking points that can prevent your blog from being fully validated. I guess there’s a bit of controversy behind this. One reason is that attributes like role help blind people use the internet via screen-readers. So does this mean all W3C compliant websites hate the blind? No, it just means they prefer the warm, fuzzy feeling of knowing their code is up to spec.
I developed a filter function (as part of the process of building my first WordPress theme) that strips out any attributes that do not conform to the W3C XHTML 1.0 Transitional specification. It shouldn’t affect the normal functionality of the blog, but it might make it harder for disabled people to enjoy your posts.
Summary of Changes
Here is a summary of the changes it makes:
- Removes
role="search"from the default search widget - Removes
aria-require="true"into comments textarea
How to Execute PHP Code from a Variable or Textbox
I’ve been working on adding options to a WordPress theme and I never had to execute user inputted PHP code before. Turns out it’s actually pretty easy. You just have to use the eval() function. Here’s an example:
$code = 'phpinfo();' // code in string form eval( $code );
That’s it! Thanks to Roshan Bhattarai for answering my Google inquiry.
Note: Official WordPress themes do not allow you to run code through
eval(), if you’re planning on getting it into the repo. The second best solution is just write to a PHP file then include it as needed.
source: How to execute PHP code entered from textbox or textarea