underblob
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Comments not workingI was running some
mysql_query ()in a theme via an external script outside of the WP install and it was interfering with the WP core, disabling the comments. Dunno if this is helpful but I resolved the problem by using$linkidentifiers on allmysql_query ()and then closing the sql session at the end of the included script withmysql_close ( $link );Forum: Themes and Templates
In reply to: get name of page template on a pageAnother way that I was solving
<body>and other formatting for templates is to create a CSS file specific for the template and then insert it dynamically into the<head>from the template. Infunctions.phpof your theme, add a function to spit out a<link>to the CSS:function mytemplate_head () { echo '<link rel="stylesheet" type="text/css" href="'.get_bloginfo('template_directory').'/mytemplate.css" />' }Then in the top of your template file before
get_header();, add this line of code:add_action ( 'wp_head', 'mytemplate_head' );Since the
mytemplate.cssfile will be loaded after your theme CSS, you can over-ride your theme CSS for<body>if you use!importantflag after your property declarations:body { background: #000 !important; }http://codex.wordpress.org/Function_Reference/add_action
http://www.w3.org/TR/CSS2/cascade.html#important-rulesForum: Themes and Templates
In reply to: get name of page template on a pageI am not sure if this will solve your problem but I found you can get boolean on the template filename via
is_page_template ( 'template_filename.php' )
http://codex.wordpress.org/Function_Reference/is_page_template