Joshua David Nelson

Bullshit Free WordPress Development

  • Services
  • Code
  • About
  • Contact

Code Snippets

Saving useful code as I find it, build it, or stumble into it.

Fork Me on GitHub

Allow shortcodes in Genesis Archive Intro Text

Allows the use of shortcodes in Genesis Archive Intro Texts/description. These settings are available for term archives, author archives, and custom post type archives.

Rename WooCommerce “Brands” to “Manufacturers”

A useful way of filtering the taxonomy arguments in WooCommerce's 'product_brand' taxonomy.

Default Category and Tag Archive Titles in Genesis 2.2.7

After version 2.2.7 Genesis utilizes the new core get_term_meta to grab the category headline and intro text. This snippet uses the term name for a default value of the headline term meta.

Pure CSS Parallax Page Header in Genesis

Add a parallax image behind a page entry header in Genesis - pure css solution. (You'll need to style your image to be tall enough to match the webpage header, so it is behind the main page header on scroll)

Force a Post to Draft on Save

Force a post to draft if specific meta is invalid (or other reason), in this case the start and end date/time.

Remove Genesis Taxonomy Meta Fields

This snippet removes the genesis taxonomy meta fields, just add to your functions.php file or a custom plugin file.

Override Genesis Theme Settings

Use this handy helper class to easily Override Genesis Theme Settings and remove theme metaboxes.

Add Shortcode Support to Custom Field Output

Filter the output of a custom field to support shortcodes within the field.

Log Errors in WordPress

Handy for development, just call it up jdn_log_me( 'An issue' );

Add WooCommerce Product Description Below Product

Add the product description below the product, see: Short Description Below Product (WordPress Forums)

Remove Genesis Inpost Layout Box on Posts

Remove Genesis inpost layout box on posts, or any post type, specifically.

Exclude Post Types From Search

This snippet allows you to remove a post type, like pages, for instance, from the search results without removing any others (by default WordPress searches posts, pages, and attachments). This will also preserve any custom post types you might have that are searchable (like those from other plugins).

Get Post Types By Taxonomy

Get post types that have a specific taxonomy, returns an array of objects or names, or false if nothing found.

Set Genesis Theme Settings Defaults

This shows everything, you can set a specific default (without changing the others) more simple with the example in the gist comments. See the defaults as listed in the (very useful) Genesis Docs Gary Jones maintains.

Migrating WordPress Site Database SQL Queries

Use this to update your database via the SQL interface when migrating a WordPress site

Remove Genesis Custom Post Type Archive Metaboxes

Remove metaboxes from the genesis custom post type archive settings page.

Taxonomy List and Dropdown Link Shortcode

Shortcode to create a list or dropdown link to taxonomy archives

Specific Page Sidebar with Genesis

Create a sidebar for a specific page with the Genesis Framework, without a new template file.

Post Avatars in Entry Header in Genesis

This places the post avatar in the entry header of feature posts (if you're using the grid loop plugin) and on single post pages. It also allows for co-author plus support, showing a different image when there is more than one author.

Exclude Scripts from Scripts-to-Footer Plugin

For use with the Scripts to Footer plugin, allows you to place specific scripts back in the head. Can be useful if you have scripts that have to live specifically in the head section and cannot live in the footer.

Check If Post Type Supports Archives

Checks if a post type supports archives and returns boolean. Handy if you are playing with custom post types and page templates.

Is_Custom_Post_Type()

Checks if the current post is a custom post type, returns boolean. Very handy when working with custom post types, layouts and the like.

Alternate Sidebar Page Template in Genesis

This allows you to use the built-in secondary sidebar as an alternate on one sidebar themes (you'll want to register a separate sidebar if you are using two sidebars in your theme layouts). This has a limited scope, I would recommend a plugin like Display Widgets if you are going to have a more complicated page-by-page application.

Remove Default WordPress Taxonomies

Remove category and tag taxonomies. Useful if you're not using the blog functionality of WordPress, including the taxonomies. Be sure to uncomment the other line if you're using Genesis to avoid errors.

Remove Genesis Entry Title Link

Customize the entry title - in this case, removing the links and changing the header type.

Force Genesis Post SEO Settings

This bit in your functions.php file will force specific settings for robots post meta. Change 'post' to a specific post type or replace with other conditional. This is handy for post types that you do not want to have single post pages included in search results, private pages, et cetera.

Feedgator RSS Aggregator

A RSS feed aggregator in php.

Snippets by Tag:

archive author avatar Categories co-author plus conditional css custom field custom post type debug filter Genesis grid loop layout metadata Page Template page type plugin post meta post save post status Post Title RSS scripts scripts-to-footer search SEO settings shortcode Sidebar sql Tags Taxonomy term meta woocommerce wp_head

  • Twitter
  • RSS Feed URL
  • Code Snippets
  • My Plugins
  • Make a Payment

© Joshua David Nelson | Hand-Forged | WordPress + Genesis | Terms of Service | Legal | Contact