How do I set a specific template for sub-categories?

There’s a few posts about getting sub-categories to use the same template as their parent but I want to do something slightly different. I have a category 67, and I want all sub-categories of 67 to use a specific template. Not the default template, and not the custom category-67.php template. How do I do that? I have the following code in functions.php, but it also seems to change the template of category-67 // use specific template depending on category function myTemplateSelect() { if (is_category() && !is_feed()) { if (is_category(get_cat_id(’67’)) ||…

Web Design Weekly #174

Headlines Font Loading Revisited with Font Events The talented Scott Jehl explains how they are saving their users from the dreaded FOIT (Flash of Invisible Text) by using font events and a clever polyfill. (filamentgroup.com) How Flipboard Chose Form Over Function (farukat.es) Get Shit Done PRO – Premium Bootstrap HTML/PSD Kit The kit is made on the basis of Twitter Bootstrap, to make it look amazing and also includes a PSD version. Give your project a fresh look and choose from the collection of beautiful pre-defined components to create the website…

Preparing for ECMAScript 6

The Standard ECMAScript 5 (referred to as ES5) was originally published late 2009 and has since moulded JavaScript to become one of the worlds most important languages. ECMAScript 6 is the upcoming version of the ECMAScript standard and expects ratification some time around June 2015. ES6 is a significant update to JavaScript, and the first update to the language since 2009. Implementation of these features in JavaScript engines is well underway as we speak. Let’s dive in and see what ES6 is all about. The Better Parts Doug Crockford lists…

Web Design Weekly #173

Headlines Client-side MVC’s Major Bug Tim Kadlec expresses some very valid concerns about the current situation with most client-side MVC frameworks. (timkadlec.com) Can Web Design Beat the Machines? (daverupert.com) Win A Big Trip To That Big Tech Festival Win a trip to everyone’s favorite tech festival. This March, one lucky winner and a friend will have the opportunity to attend the festival-that-cannot-be-named in style, get VIP access to the coolest parties, and meet some of the top thought leaders in the tech world. Apply Now. (generalassemb.ly) Articles 60FPS on The…

Magnific Popup – Add Caption to Images

My theme uses Magnific Popup as follows in theme.js /* add lightbox for blog galleries */ $(« .gallery a[href$=’.jpg’],.gallery a[href$=’.jpeg’],.featured-item a[href$=’.jpeg’],.featured-item a[href$=’.gif’],.featured-item a[href$=’.jpg’], .page-featured-item .slider a[href$=’.jpg’], .page-featured-item a[href$=’.jpg’],.page-featured-item .slider a[href$=’.jpeg’], .page-featured-item a[href$=’.jpeg’], .gallery a[href$=’.png’], .gallery a[href$=’.jpeg’], .gallery a[href$=’.gif’] »).parent().magnificPopup({ delegate: ‘a’, type: ‘image’, tLoading: ‘<div class= »loading dark »><i></i><i></i><i></i><i></i></div>’, mainClass: ‘my-mfp-zoom-in’, gallery: { enabled: true, navigateByImgClick: true, preload: [0,1] // Will preload 0 – before current, and 1 after the current image }, image: { tError: ‘<a href= »%url% »>The image #%curr%</a> could not be loaded.’, verticalFit: false } }); I would like to modify this…

You have an error in your SQL syntax – Help with query

I have a programmer that developed a custom plug in for a client’s website and after moving the site to client’s server, some parts are not working. Looking at the error log, there is an issue with his queries. The coding seems a little poor to me and when I looked at it, I noticed that he hardcoded the table prefix in the queries, so I suspect that the rest of his code is poorly written. The error message I get is: WordPress database error You have an error in…

Place page title in header?

Normally, in WordPress, the page title appears in the content area. I’d like to have the page title appear in the header area. It looks like to do that, I’d have to remove it from its current location in the content-page.php and place it in header.php. But content-page.php is called from page.php, which calls the content-page from within a while loop (while ( have_posts() ) : the_post(); … ) — so I’d have to move or copy this into the header as well, I think. Seems like a lot of…

Sort search results by post type

I need to sort my search results by custom post type. the problem: the order is custom. I do have 5 different post types and i got the order like so: artist artwork page post publication I’d like the order to be like this: artist post artwork publication page Here is what I have so far, the elements are grouped by their post type and get sorted by title. Wonderful. Now all I need is the custom ordering. Any hint? add_filter( ‘posts_orderby’, ‘order_search_by_posttype’, 10, 2 ); function order_search_by_posttype( $orderby ){…

Web Design Weekly #172

Headlines Using Flexbox today A strategy of how you can enhance your layouts with Flexbox today without having to wait around for browsers to catch up. Included are some suggestions of possible layout enhancements, tips, and common issue troubleshooting as well as some step by step examples of the card pattern and the split screen layout pattern. (chriswrightdesign.com) “A Web For Everybody” by Marcy Sutton (vimeo.com) You know how to code, but how are your design skills? Do you ever wish your websites & apps looked more “professional”? Take one…

Create a drop down list within an active page not nav menu

I am working for a client that has requested a drop down list for some categories within a page, i.e. click on the link and a list drops down to select the page you want to view. Everything I seem to be finding is telling me how to create the drop down in the nav bar, that is not what I need. Any help is greatly appreciated… Source: https://wordpress.stackexchange.com/feeds