Today I had to troubleshoot an Events Manager issue which turned out to be caused by the plugin's code being set up to process one conditional at a time. For example the following code will execute only the first conditional, {is_future}{/is_future}: {is_future} {has_image}Show the image as #_EVENTIMAGEURL{/has_image} {no_image}Show a default image{/no_image} {/is_future} The {has_image} and {no_image} conditionals will be ignored. To fix this you must manually edit your wp_options table: option_name = dbem_conditional_recursions option_value = 2 Set the value to 1 or more. In this case you would use 2 since there are 2 nested conditionals … [Read more...]
Center menus in Genesis
It drives me nuts that there's no obvious, easy way to center the nav bar in Genesis (or, to be fair, in most WordPress themes/frameworks). Stumbled across this the other day and found it works really well. If you are using a subnav, change #nav to #subnav in the above CSS. If you are using both the top menu and the bottom menu, use two versions of the CSS: one for #nav and one for #subnav. It is possible to write it as, for example, #nav .wrap, #subnav .wrap {} etc… to minimize page sizes. (Lifted from journalxtra.com) … [Read more...]
Detect Mobile Browser and Serve Up Alternate Content (or nothing)
The site we just built for faithandform.com has a pretty cool slideshow feature on the home page, serving up a portion of the four most recent issues' cover images and tables of content. But it doesn't work well at all on small mobile devices, so Joe and I spent some time poking around the tubes until we worked this out: Which is all based on a post we found here. (You're going to need this file, too.) … [Read more...]
YouTube and Vimeo Embed Shortcodes
We don't always need a full-blown plugin to do something like embed videos, especially if we'll be doing the site updates, so we whip up shortcodes to handle that kind of stuff. Here's a simple one to pull in videos from YouTube and Vimeo. … [Read more...]
Fix Double Sidebar Problem with Genesis CPT Archives Plugin
Exclude Posts, Pages, or Categories from Search Results
I tend to use pages or categorized posts to fill widgets on home pages, because it provides users with an easy way to change various areas on their home page or sidebars. Sometimes, though, we don't want that content to show up in searches. Here's how to exclude them: … [Read more...]
Force full-width layout with Genesis and CPTs
I needed to force a full-width-layout on my single custom type page. After a bit of trial and error, I ended up with this code: Just replace CPTNAME with your custom post type name and you're good to go. … [Read more...]
Add login/logout to WP’s built-in menus
Here's an easy way to add WordPress's built-in login/logout link to the your menus. I have it coded to work with Genesis's menus, but you can make this work with any theme by changing the theme_location argument. … [Read more...]
Gravity Forms / jQuery UI Datepicker Too Narrow; or, { box-sizing: border-box }
Gary Jones whipped up an especially helpful little tip for Gravity Forms based on Paul Irish's border-box advice. Seriously helpful stuff. As Paul said: One of my least favorite parts about layout with CSS is the relationship of width and padding. You're busy defining widths to match your grid or general column proportions, then down the line you start to add in text, which necessitates defining padding for those boxes. And 'lo and behold, you now are subtracting pixels from your original width so the box doesn't expand. I'm right there with him. A bit of CSS applied to all elements fixes the problem: … [Read more...]
Types & Views: check for image; if none, display default image
This comes in handy if you don't want a big empty hole where a graphic or photo should be. Comes in handy when someone forgets to upload an image. … [Read more...]