Is it possible to use the featured image of a page as a css background without inlining?

There’s two possible options in creating a stylesheet from a dynamically generated value. The first options is Inline stylesheet, as follows: <div id=”hero” style=”background-image: url(<?php // TODO retrieve image here. ?>); “> </div> And the second options is to use an Internal stylesheet, and possibly the best solution out of both. Using stylesheet internally requires … Read more

Why is wordpress searching for @2x images?

Despite having no plugins installed through wordpress, I did have retina.min.js being enqueued in my functions.php file from the template I downloaded. Retina.min.js (source: http://imulus.github.io/retinajs/) looks for high resolution versions (denoted with suffix @2x right before the extension) of each image in your site and attempts to replace them if any are found. Since I … Read more

Query children and parent title

I’m not entirely sure if I get your problem correctly, because of the “it’s not an option part”, but… You get children pages of page with ID = 2, so it looks like you want to display the title of that page. If so, then this code will solve your problem: <?php $args = array( … Read more

How can I make my custom templates respect permissions?

Message you quoted is being generated by members_content_permissions_protect() function. By default it is used as a filter on the_content() and the_excerpt() functions. Since your custom template doesn’t use these – there is no case for function to run. Try something like this in template: $content=”Content to protect”; echo members_content_permissions_protect( $content ); Another idea: $protected = … Read more

How to control template resolution if both Author and Category filter in place?

You could change the template loaded by hooking onto template_include, checking if is_author and is_category are both set, then switch the template for inclusion to the author template instead. Give this a shot.. add_filter( ‘template_include’, ‘my_template_setter’ ); function my_template_setter( $template ) { if( is_author() && is_category() && is_archive() ) $template = get_author_template(); return $template; } … Read more

modifying a template and adding jQuery to it

Rather than modifying the template, since you’re going to need jQuery anyway, you can do this.. Add to the functions.php add_action( ‘wp_enqueue_scripts’, ‘blogroll_toggles’ ); function blogroll_toggles() { if( is_page_template( ‘bookmarks.php’ ) ) wp_enqueue_script( ‘blogroll-toggle’, get_bloginfo( ‘stylesheet_directory’ ) . ‘/blogroll-toggle.js’, array( ‘jquery’ ) ); } Or create a new folder in the wp-content/plugins/ folder, create a … Read more

Can I apply a WP theme to a specific custom page template?

In fact there is, using template_redirect, which you would put in the functions.php file – Here’s what I use: function uniquename_default_template() { if(get_post_type() == ‘posttype’) : /* You could use is_single() instead of get_post_type() == ” or any type of conditional tag) */ include(TEMPLATEDIR . ‘path/to/theme/file.php’); /* You could use TEMPLATEDIR to get a file … Read more