michaelfox + wordpress   108

Pears - common patterns of markup & style
Collect, test, and experiment with interface pattern pairings of CSS & HTML. Pears is an open source WordPress theme, enabling people like you to get your own pattern library up and running quickly.

Grab the theme at Github.
Install the theme.
Create markup & style patterns.
Learn.
css  html  html5  css3  framework  patterns  bestpractices  snippets  wordpress  php  elements  reference  forms  breadcrumbs  buttons  pagination  tables  slats  thumbnails  lists 
11 weeks ago by michaelfox
Load WordPress from a CLI not in the global scope — Gist
<?php

// When loading WP from phpunit, phpunit doesn't run WP in the global scope.
// This breaks WP. This is an attempt to fix it.

function de_globalize_wp() {
// pretend this is apache
// I use $_SERVER['HTTP_HOST'] or a file called "host" to get the right DB settings
$_SERVER['HTTP_HOST'] = trim(file_get_contents(__DIR__ . '/host'));

$_SERVER["REQUEST_METHOD"] = 'GET';
$_SERVER["SERVER_PROTOCOL"] = 'HTTP/1.0';
$_SERVER["SERVER_PORT"] = '80';
$_SERVER["SERVER_NAME"] = $_SERVER["HTTP_HOST"];
$_SERVER["REMOTE_ADDR"] = 'localhost';
$_SERVER["REMOTE_PORT"] = '80';
$GLOBALS[ '_wp_deprecated_widgets_callbacks' ] = array();

// WP assumes it's being loaded globally
global $wp_version;
global $PHP_SELF;
global $wp_embed;
global $wpdb;
global $wp_rewrite;
global $wp_the_query;
define( 'DOING_AJAX', true );

include 'wp-load.php';
}

de_globalize_wp();

echo "It actually worked!\n";
wordpress  cli  php 
may 2011 by michaelfox
Our WordPress Developer Toolbox - WordPress, Add-on, Firefox, Linux, Developer, Windows - WP Engineer
WordPress

As I develop primarily in and for WordPress, I have a few small Plugins in the test environment active, which ease my view on certain data, and which specifically save errors or issues in WordPress. A small list with short explanation of Plugins, even if I don't use all of them, but there might be one or two in this list you like.

WP Developer Assistant - because it has some reports and feature, which are very handy
CodeStyling Localization - because you can create a Plugin multilingual, it's easy to create new language files
Log Deprecated Calls - not always in use, but can be useful
Error Reporting
Debug Queries - Analysis of queries
Debug Objects - Evaluates many values
Adminer - for the fast access to your webspace or as Plugin directly in your WordPress
FirePHP - as Plugin for WordPress to access specific content without crawling through your source code
WordPress Hook Sniffer - interest idea; bad is the replacing of the core-file plugin.php
That should be enough, even there are many more for sure. The decisive factor, in my view are not the Plugins, but the environment with xDebug and the settings that WordPress offers as standard in this context. Therefore, I can only recommend to have the following lines in the wp-config.php of the environment.

/** Debugging WP */
define('WP_DEBUG', true); //enable the reporting of notices during development - E_ALL
define('WP_DEBUG_DISPLAY', true); //use the globally configured setting for display_errors and not force errors to be displayed
define('WP_DEBUG_LOG', true); //error logging to wp-content/debug.log
define('SCRIPT_DEBUG', true); //loads the development (non-minified) versions of all scripts and CSS and disables compression and concatenation,
define('E_DEPRECATED', false); //E_ALL & ~E_DEPRECATED & ~E_STRICT
define('AUTOSAVE_INTERVAL', '300'); // Autosave interval
define('SAVEQUERIES', true); // Analyse queries
define('WP_POST_REVISIONS', false);
These definitions make the work easily with WordPress and there are many indications of WP to have a clean code and current functions. I change the autosave interval only to small values, if I work in this segment, so if I need the script as soon as possible.
wordpress 
march 2011 by michaelfox
Options Framework Plugin | WordPress Theming
The Options Framework Plugin makes it easy to include a full featured options panel in any WordPress theme. It’s originally based on the excellent work of Woo Themes.

I built this plugin so theme developers can concentrate on making the actual theme rather than spending a ton of time on building an options panel from scratch. It’s free to use in both commercial and personal projects, just like WordPress itself.

Video Demo
Overview (minutes 1-4), How to Integrate (minutes 4 – 13:30), Portfolio Press (minutes 13:30 – 17), Closing Reemarks (minutes 17 – 19).
framework  wordpress  php 
march 2011 by michaelfox
Customize WordPress Quicktags • Perishable Press
Note: This condensed tutorial assumes you are working with WordPress 2+ and are familiar with editing .php and/or .js files.

WordPress quicktags1 provide shortcuts for adding certain bits of code to your posts. The default set of quicktags includes some handy shortcut buttons for tags such as <strong>, <a>, and <img>, as well as a few others. While the default set of quicktag buttons is occasionally useful, a quick bit of quicktag customization can easily transform your personal set of quicktag buttons into a deadly arsenal of time-saving code shortcuts.

First, open the quicktags.js file, usually located in the wp-includes/js directory. Next, scroll down to around line #40 and look for the following chunk of code:
wordpress  quicktags  javascript  wysiwyg  tinymce 
august 2010 by michaelfox
Our WordPress Developer Toolbox - WordPress, Add-on, Linux, Developer, Firefox, Windows - WP Engineer
As I develop primarily in and for WordPress, I have a few small Plugins in the test environment active, which ease my view on certain data, and which specifically save errors or issues in WordPress. A small list with short explanation of Plugins, even if I don't use all of them, but there might be one or two in this list you like.

* WP Developer Assistant - because it has some reports and feature, which are very handy
* CodeStyling Localization - because you can create a Plugin multilingual, it's easy to create new language files
* Log Deprecated Calls - not always in use, but can be useful
* Error Reporting
* Debug Queries - Analysis of queries
* Debug Objects - Evaluates many values
* Adminer - for the fast access to your webspace or as Plugin directly in your WordPress
* FirePHP - as Plugin for WordPress to access specific content without crawling through your source code
* WordPress Hook Sniffer - interest idea; bad is the replacing of the core-file plugin.php

That should be enough, even there are many more for sure. The decisive factor, in my view are not the Plugins, but the environment with xDebug and the settings that WordPress offers as standard in this context. Therefore, I can only recommend to have the following lines in the wp-config.php of the environment.
code  development  tools  wordpress  php  debugging  troubleshooting  toolkit 
august 2010 by michaelfox
Convert Content of Pre-Tags in HTML-Code - WordPress, Sergej, Snippets, Guest, Advanced, Code - WP Engineer
There are two different ways to display a source code instead of executing a source code in a post or page. Depending on preferences which HTML tag is defined in the style sheet and provided with formatting, code fragments are either declared by <code> or <pre>. In some cases, combining the blogger even both tags.
Conversion of special characters

If you want to use the pre Tag, then you have to take care that the code snippets, while parsing, are not executable. HTML-Entity is the solution.

Two options are available: One, manually, such as search and replace before pasting into the editor (HTML-Entities-table). but if you are smart you let WordPress doing the job.

Numerous methods for the simple conversion of the code set between pre-and/or code tags are on the web. But there is one for the direct use in WordPress, which takes over to convert the characters perfectly since WordPress 2.8.
wordpress  php  code  source  blog  escaping  html  entities  pre  plugin 
august 2010 by michaelfox
10 Sites That Produce Quality WordPress Content
10 Sites That Produce Quality WordPress Content
1. wpazo.com
2. WPEngineer.com
3. WPRecipes.com
4. WPTavern.com
5. JustinTadlock.com
6. WeblogToolsCollection.com
7. PlanetOzh.com
8. ProBlogDesign.com
9. ThemeShaper.com
10. WP-Fun.co.uk
27 Comments
Subscribe
Twitter
Popular Posts
The Fine Print
wordpress  php  blogs  list  resources 
july 2010 by michaelfox
WordPress Default CSS Styles | Digging into WordPress
WordPress gives us full control over the presentation of our websites. We specify which classes and attributes to use in our template files, and then apply CSS using our theme’s custom stylesheet. Behind the scenes, WordPress generates its own classes and IDs, and applies them to specific HTML elements in theme files and database content. Having these default hooks available makes it super-easy to custom-style your theme’s blockquotes, post images, widget items, and much more.

In addition to generating default classes for your site’s “front-end” (public-facing) pages, WordPress also employs a default set of CSS attributes for the Admin, or “back-end” pages. If you’ve ever delved into the convoluted CSS stylings of the WordPress Admin, you will understand why we focus exclusively on front-end attributes in this article. The goal is to include all classes and IDs generated for database content, theme template files, and default widget items.

Fortunately, most (if not all) of your WP CSS work happens at the “theme” or “post” level. And when you do need to style the Admin, it’s usually easiest to just do it en bloc via plugin. You can also do it the old-fashioned way.
wordpress  css  stylesheet  framework  template  php 
july 2010 by michaelfox
Transients API « WordPress Codex
Codex

Codex tools: Log in
Transients API
Contents
[hide]

* 1 Function Reference
* 2 Using Transients
o 2.1 Saving Transients with set_transient()
o 2.2 Fetching Transients with get_transient()
o 2.3 Removing Saved Transients with delete_transient()
* 3 Complete Example

This page contains the technical documentation of the WordPress Transients API, which offers a simple and standardized way of storing cached data in the database temporarily by giving it a custom name and a timeframe after which it will expire and deleted.

The transients API is very similar to the Options API but with the added feature of an expiration time, which simplifies the process of using the wp_options database table to store cached information.

Also of note is that Transients are inherently sped up by caching plugins, where normal options are not. A memcached plugin, for example, would make WordPress store transient values in fast memory instead of in the database. For this reason, transients should be used to store any data that is expected to expire, or which can expire at any time. Transients should also never be assumed to be in the database, since they may not be stored there at all.

The intended audience for this article includes WordPress theme authors, plug-in authors and anyone who needs to cache specific data but wants it to be refreshed within a given timeframe. This document assumes a basic understanding of PHP scripting.
wordpress  cache  performance  transients  api  php  database  speed 
july 2010 by michaelfox
Registering New Sidebars for Custom Page Templates The Smart Way
#
function is_pagetemplate_active($pagetemplate = '') {
#
global $wpdb;
#
$sql = "select meta_key from $wpdb->postmeta where meta_key like '_wp_page_template' and meta_value like '" . $pagetemplate . "'";
#
$result = $wpdb->query($sql);
#
if ($result) {
#
return TRUE;
#
} else {
#
return FALSE;
#
}
#
} // is_pagetemplate_active()
conditional  sidebars  pages  templates  wordpress  php 
july 2010 by michaelfox
Your First WordPress Plugin: Simple Optimization | Nettuts+
Your First WordPress Plugin: Simple Optimization
Tutorial Details
Step 0 Before we Begin
Step 1. What our Plugin Does
Remove useless meta tags:
Remove unnecessary filters:
SEO:
Step 2. Laying the Groundwork
Step 3. Adding Features
Step 4. SEO
Step 5. Optimizing the Database
Step 6. Filling out the ReadMe
By Jonathan Wolfe
wordpress  php  plugin  seo  optimize  tutorial 
july 2010 by michaelfox
WordPress 3.0 Theme Tip: The Comment Form » Otto on WordPress
WordPress 3.0 has something very handy that I want theme authors to start implementing as soon as possible.

To show exactly why it’s so useful, I modified my own theme to start using it.
Demonstration

So, here’s a big hunk of code I pulled out of my current theme’s comments.php. This hunk of code has only one purpose: To display the form area where people can leave a comment:
wordpress  comment_form  hooks  filters  php 
july 2010 by michaelfox
Editor Styles for Custom Post Types in WordPress 3.0 | WP Storm
add_editor_style() which allows you to assign a CSS file for the TinyMCE when editing posts, pages and the new custom post types. This is very handy to get closer to a WYSIWYG experience in WordPress’ editor and not having to preview the posts all the times while writing, to check where line breaks end up and so on (if you care about those things).

I’m also loving the new Custom Post Types, and on one of my sites, I have setup a few different post types. On the frontend I have different widths for posts, pages and my new WordPress 3.0 custom post type ‘portfolio. I wanted to reflect the different widths in my admin editor style sheet as well. The posts are the narrowest ones, while pages are wider and my custom post type portfolio is the widest, so I have made 3 style sheets which are pretty much the same, with the exception of the
wordpress  editor  tinymce  mce  wysiwyg  add_editor_style  css  posts  post_type  editor-style 
july 2010 by michaelfox
Adding and using custom user profile fields
Since I’ve been playing around with user management a lot lately, I thought I’d share a simple technique I picked up. This technique will allow you to easily add new user profile fields that your blog’s users can use to input more information about themselves.

Management of these fields will be coming in a later version of my user management plugin, but some of you may want to do this now.

In this tutorial, I’ll show you how to add an input box for a Twitter username and how to display it on your site, which will look a little something like this:
wordpress  authors  author  bio  custom  fields  php  profile 
june 2010 by michaelfox
Plugin API/Action Reference « WordPress Codex
Actions Run During a Typical Request

These actions are run when a logged-in user opens the home page in Version 2.9.

1. muplugins_loaded
2. load_textdomain
3. update_option
4. plugins_loaded
5. load_textdomain
6. sanitize_comment_cookies
7. setup_theme
8. load_textdomain
9. auth_cookie_malformed
10. set_current_user
11. init
12. widgets_init
13. load_textdomain
14. parse_request
15. send_headers
16. pre_get_posts
17. posts_selection
18. wp
19. template_redirect
20. get_header [first printed output to the browser]
21. wp_head
22. wp_enqueue_scripts
23. wp_print_styles
24. wp_print_scripts
25. loop_start
26. the_post
27. loop_end
28. get_footer
29. wp_footer
30. wp_print_footer_scripts
reference  wordpress  documentation  hooks  api 
june 2010 by michaelfox
The 13 Most Essential Plugins for WordPress | Nettuts+
WordPress is a very powerful and flexible blog/content management system, but the thousands of plugins really help to extend the basic functionality. Here are 13 essential plugins that you should immediately install after finishing the WordPress installation.
blog  plugins  wordpress  security  backup  spam 
may 2010 by michaelfox
20 Plugins That Extend the Standard WordPress Feature Set | tripwire magazine
20 Plugins That Extend the Standard WordPress Feature Set Unlimited possibilities characterize the WordPress platform. Users are not limited by the features included with its base install, but have virtually limitless capacity to extend, expand, and adapt WordPress to their particular needs. Here are twenty plugins for WordPress that expand its feature set to do great things.
wordpress  plugins 
may 2010 by michaelfox
Function Web Design & Development Blog - » Beautiful Post Thumbnails: Top Examples & Best Practices
Your blog post thumbnail will play a big part in how your users see your website, and how they navigate it. A well designed post thumbnail can really engage your visitors and help encourage them to explore your website.
webdesign  blow  wordpress  thumbnails  inspiration 
may 2010 by michaelfox
Function Web Design & Development Blog - » Tutorial: Creating Custom Write Panels in WordPress
Everyone knows that WordPress is one of the most, if not the most, popular blogging systems on the internet today. With its out of the box features, plugins, and great theming community, its no wonder WordPress has been accepted as today’s standard. However, sometimes you just want to add a little more.

It seems the latest fad to hit the WordPress scene is adding thumbnails into a blog post. This is fairly easy to do with some knowledge of custom fields, but can be a little complicated if your client is new to WordPress, or blogging.

Luckily, WordPress has a solution for us. We are going to use a little something called add_meta_box.
admin  template  theme  wordpress 
may 2010 by michaelfox
Weekend Tip: Author Comment Styling In WordPress | Nettuts+
An often-used feature in WordPress blogs is the ability to style comments made by the post’s author differently from the others – helping replies to stand out. Here, we will edit the default WordPress to add some subtle styling to author comments.
wordpress  comments 
may 2010 by michaelfox
Create a "Recent Posts" Module Outside of WordPress
The websites I create are never powered by WordPress. Sure I may add a blog to the website but I’ve never created a client website that was run by the powerful blogging software. In an effort to tie the website and blog together, I’ll usually do some quick PHP/MySQL programming to pull in recent blog post titles and links to the individual posts. Here’s the PHP and MySQL that accomplishes that task.
wordpress  php  external  recentposts  module  database  mysql  sql  query  posts  recent 
may 2010 by michaelfox
Add Custom Values To Your WordPress RSS Feed | Script & Style
WordPress creates two different feeds: a basic RSS feed and an Atom feed. Script & Style, like almost every other blog out there, uses FeedBurner to serve the syndication feed, and we chose to have FeedBurner use the Atom feed. In our experience, the Atom feed has been more stable and doesn’t cause problems in Google Reader like the basic RSS version does from time to time. Since we’re serving the Atom feed, we’ll need to modify the feed-atom.php file.
wordpress  rss  atom  customization  xml  feed  php 
may 2010 by michaelfox
Top 5 WordPress Security Tips You Most Likely Don’t Follow
I recently gave a presentation at WordCamp Montreal on WordPress Security. While doing research for my presentation I came across a bunch of great WordPress Security tips that all WordPress users should use. Surprisingly, a good majority of these tips are not usually followed. Below is a list of the top 5 tips that most WordPress administrators do not do, but should:
apache  htaccess  tips  mod_rewrite  security  routing  wordpress  install  config 
may 2010 by michaelfox
Ultimate Htaccess Tutorial for .htaccess files
This is not an introduction to .htaccess… This is the evolution of .htaccess… The best of the best .htaccess info I can find.

Originally known as the Ultimate .htaccess Guide, its changed over the years with more and better .htaccess tricks using real .htaccess example code. I add my favorite htaccess-related links and sites, results from my best .htaccess experiments, and frequently update this article.

You’ve come to the right place if you are looking to acquire mad skills for using .htaccess files.
apache  htaccess  tips  mod_rewrite  security  routing  wordpress  install  config 
may 2010 by michaelfox
Hardening WordPress « WordPress Codex
Some of WordPress' cool features come from allowing some files to be writable by web server. However, letting an application have write access to your files is a dangerous thing, particularly in a public environment.

It is best, from a security perspective, to lock down your file permissions as much as possible and to loosen those restrictions on the occasions that you need to allow write access, or to create special folders with more lax restrictions for the purpose of doing things like uploading images.

Here is one possible permission scheme.

All files should be owned by your user account, and should be writable by you. Any file that needs write access from WordPress should be group-owned by the user account used by the webserver.
wordpress  security  file  permissions  priveleges  chmod  install  setup  config 
may 2010 by michaelfox
Essential Wordpress Plugin Development Resources, Tutorials and Guides - Speckyboy Design Magazine
Writing your own Wordpress plugin is not that difficult if you are a web developer with basic PHP skills. The only thing you will need, coupled with your PHP skills, is some direction, some resources, a little information on how WordPress expects your plugin to behave and, most importantly, a great idea.
If you are a newbie, don’t be put off or daunted by all the code, ultimately a plugin is only program, a set of functions, that adds a specific set of features and services that can be executed in different sections of your WordPress site.
This article covers Wordpress Plugin Development, from tutorials, useful resources, how-tos, guides and some cheat sheets.
wordpress  plugins  development  tutorial  reference  resources  documentation 
april 2010 by michaelfox
Highlight Source Pro: Sourcecode Highlighting WordPress-Plugin — blog.kno.at
# Highlight sources of any language
# automatically, server-side (no javascripts)
# XHTML-Compliant, <div>, <ul> & <span>’s with class-attributes and a css-file are used for styling
# optionally add a heading for every code-block
# optionally specify line-number offset (BREAKS XHTML COMPLIANCE)
# optionally don’t display line-numbers
# set per-codeblock if the code is html_entity_encoded or not
# only parses <pre>-tags with the lang-attribute, thus does not interfere with any regular preformatted contents you might have
# degrades beautifully through <pre>-tags (if you keep the sources clean, that is)
# all settings through logical, valid arguments for the main container
# comes with generic cross-browser (IE5/Mac, IE5.5+, FF, Safari, Opera) default CSS-styles
syntax  highlighting  code  blog  wordpress  plugin  geshi 
april 2010 by michaelfox
« earlier      

related tags

add_editor_style  admin  analytics  apache  api  asides  atom  author  authors  backup  bash  bestpractices  bio  blacklist  blog  blogs  blow  boilerplate  bookmarklet  bots  breadcrumbs  buttons  cache  caching  cheatsheet  chmod  cli  code  codehighlighter  codeigniter  collection  comments  comment_form  compression  conditional  config  crawler  css  css3  custom  customization  database  debugging  deployment  design  development  documentation  editor  editor-style  ee  elements  entities  environment  escaping  expressionengine  external  facebook  feed  fields  file  filters  firewall  forms  framework  free  functions  geshi  gist  git  google  gzip  hacks  highlighting  hooks  howto  htaccess  html  html5  image  images  import  inspiration  install  installer  integrating  javascript  jquery  like  linkblog  list  lists  loop  magazine  markdown  mce  meta  minimal  minimalist  module  mod_rewrite  multisite  mysql  optimization  optimize  options  pages  pagination  patterns  performance  permissions  phing  php  plugin  plugins  post  post-image  posts  post_type  pre  priveleges  profile  query  question  quicktags  recent  recentposts  reference  resources  robots.txt  routing  rss  scraper  script  scripting  security  seo  server  settings  setup  sharing  shell  shortcodes  sidebars  skeleton  slats  slide  snippets  social  socialnetworking  source  spam  speed  sql  stackoverflow  stylesheet  syntax  tables  taxonomies  template  templates  theme  themes  thesis  thumbnail  thumbnails  tinymce  tips  toolbox  toolkit  tools  transients  troubleshooting  tumblog  tutorial  twitter  ui  web  webdesign  webdev  widgets  wordpress  wp_enqueue_script  wysiwyg  xml 

Copy this bookmark:



description:


tags: