Forum Replies Created
in_category lets you check if a post or posts are in a specific category, then you can do stuff with those posts.
is_category checks if a specific category (or categories) archive is being displayed, then lets you do stuff with those categories.
I’d take a close look at the advertising scripts you’re using.
It looks like if you’re using an array you need to NOT put the single-quote around the ID. Check out the example from the Codex:
is_category( array( 9, 'blue-cheese', 'Stinky Cheeses' ) );
// Returns true when the category of posts being displayed is either term_ID 9, or slug "blue-cheese", or name "Stinky Cheeses".
When in doubt, I nearly always go to the WordPress Codex and search for the function or whatever it is I have a question on. I think you’ll find your answer on this Codex page in the examples: http://codex.wordpress.org/Function_Reference/is_category
And for inserting code here in the forums, after I type or paste it in I switch over to the HTML tab, select the code, and click on the “code” button in the toolbar. Your code needs to be single-spaced for it to work, but I’ve found that I can switch back and forth from Visual to HTML and the code styling stays there. Here’s an example (from that Codex page):
is_category( '9' );
// When the archive page for Category 9 is being displayed.
You can add this code to your home.php file to remove the Loop and the sidebar from your home page:
remove_action( 'genesis_loop', 'genesis_do_loop' );
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
Then you could do something similar to remove the sidebar on the other page templates, or work up a function with a conditional in your functions.php file and specify which pages it runs on.
I was able to duplicate this on a new development site that I’m working on, and after looking on Google I found this solution, which I tried and it worked for me. It involves a database SQL query, but it works.
I’d still double-check the existence of a comment plugin of some sort. Something is adding a math captcha to the comment form, unless that’s included in WordPress now?
You could use a plugin, but I think you’ll be better off in the long run by learning how to actually write and use the code for CPTs.
I’d start in the Codex: http://codex.wordpress.org/Custom_Post_Types
And then have a look at these: