bloginfo(‘template_directory’) img src

I am lazy loading some images with URLs which are added via custom fields. The lazy load plugin I’m using requires a place-holder image in the src attribute and the actual image in data-original. http://www.appelsiini.net/projects/lazyload I need the image height and width as well, so I’ve been using wp_get_attachment_image_src(). My problem is using bloginfo(‘template_directory’) to … Read more

How do I create new content pages for my Custom Post Type?

I am using Underscores starter theme and I’ve created a custom post type video. $args = array( ‘label’ => __( ‘Video’, ‘text_domain’ ), ‘description’ => __( ‘Videos’, ‘text_domain’ ), ‘labels’ => $labels, ‘supports’ => array( ‘title’, ‘editor’, ‘thumbnail’, ‘custom-fields’, ), ‘taxonomies’ => array( ‘category’, ‘post_tag’ ), ‘hierarchical’ => false, ‘public’ => true, ‘show_ui’ => true, … Read more

On this day PHP code

I’m working with this code snippet for an “on this day” type post. However it is only showing 1 year in the past. I’m looking to automate this so it shows on this day in 2009, 2010, 2011… and as the years advance, keep these years showing. With the way it’s written as a -1, … Read more

WordPress not respecting template hierarchy (fetches index.php instead of single.php or page.php)

I’ve encountered a strange error while developing a custom theme. After finishing editing the template for a custom post type single view, I passed onto working at the template files for pages and I ealized that WordPress was actually pointing to index.php template file rather than page.php in my theme for generating the page appearance. … Read more

How can I force custom post type to use a specific template?

I’m creating a newsletter website and each newsletter landing page uses the same template as the front page. Is there anyway to force each newsletter landing page to use the front page template. Editors can chose the template by template name in the page attributes box when editing a newsletter but I’m wondering if there … Read more

Angularjs Template Default Value if Binding Null / Undefined (With Filter)

I have a template binding that displays a model attribute called ‘date’ which is a date, using Angular’s date filter. <span class=”gallery-date”>{{gallery.date | date:’mediumDate’}}</span> So far so good. However at the moment, if there is no value in the date field, the binding displays nothing. However, I would like it to display the string ‘Various’ … Read more