How can I make different page templates for one category?

Make 1 template, and do a conditional on the meta info to either include a different stylesheet, or a entire different file altogether. $colour = get_post_meta(the_ID(), ‘color’); switch($color) { case ‘red’: include(‘category-car-red.php’); // or just different CSS break; case ‘green’: include(‘category-car-green.php’); // or just different CSS break; // etc }

Fetching Image from other post/page with custom type

You can achieve that in many ways , but providing that you use a relatively new wordpress, you should use the_post_thumbnail(). you define it in functions.php , like so : add_theme_support( ‘post-thumbnails’ ); //thumnails set_post_thumbnail_size( 150,230, true ); // defaultpost thumbnails add_image_size( ‘your-custom-name-2’, 400, 9999 ); // some size thumbnail add_image_size( ‘your-custom-name-2’, 400, 300,false ); … Read more

Template tag for /page/# structure

WordPress provides is_paged() which returns true on any archive or blog that stretches over multiple pages. This isn’t what you want, but the is_paged Codex article tells us where to go: If you need to check which page of the blog you are on, you can look in $wp_query->query_vars[‘paged’]. Remember that inside functions you might … Read more

trying to add custom landing page to Twenty Eleven- can’t get rid of Twenty Eleven header/container? [duplicate]

as you seem to be using a page template, you can edit this even more and directly integrate the essential header and footer code into that template; have a look at this example I recently made up: http://pastebin.com/ZiteZrUX <?php /** * Template Name: Blank Page Template * * @package WordPress * @subpackage Twenty_Eleven */ ?> … Read more

Background of default template showing instead of the background of custom page template

As I suspected, the issue is where/how you’re outputting your custom stylesheet. First, move this to functions.php: function mypage_head() { echo ‘<link rel=”stylesheet” type=”text/css” href=”‘.get_bloginfo(‘template_directory’).’/OldSkool-src/style.css”>’.”\n”; } add_action(‘wp_head’, ‘mypage_head’); Second, change the action into which you’re hooking your callback. You’re using wp_head. All other stylesheets will be using wp_print_styles. The wp_print_styles action fires inside of the … Read more

Recents posts pulling from different post type

This is an attempt to fix your sidebar code : <div id=”rightcolumn-wrapper”> <div class=”rightcolumn-inner”> <?php /* Widgetized sidebar */ if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘sidebar’) ) : ?> <?php /* If a title has been provided, we’ll use that. */ $NewsTitle=get_option(‘NewsTitle’); if ($NewsTitle) { echo ‘ <h3 class=”news”>’; echo $NewsTitle; echo ‘</h3>’; // Otherwise we’ll use … Read more

Lead Generation with Cookies in WordPress

Try using the jQuery Cookie plugin You can set a cookie to start with that could be called InfoSubmitted with value of ‘No’ and when they submit their info it changes to ‘Yes’ To set the cookie first make sure jQuery and the Cookie plugin are installed and then use this: jQuery.cookie(‘InfoSubmitted’, ‘No’); Once the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)