Different size video display for category page (smaller) & detail page (larger)

The best solution here is to use the built-in filter for embed parameters: <?php function mytheme_embed_defaults( $defaults ) { return array( ‘width’ => 100, ‘height’ => 100 ); } add_filter( ’embed_defaults’, ‘mytheme_embed_defaults’ ); ?> This code can be added to your theme’s functions.php file and you can change the numbers to reflect the sizes that … Read more

adding a #hash to each link in list_pages()?

I”d wrap it in a function (save it in functions.php); function wp_list_pages_with_hash( $hash, $args=”” ) { $add_hash = create_function( ‘$link’, ‘return $link . “#’ . $hash . ‘”;’ ); add_filter( ‘page_link’, $add_hash ); $result = wp_list_pages( $args ); remove_filter( ‘page_link’, $add_hash ); return $result; // back compat in case ‘echo’ was null } Then call … Read more

WordPress – using sessions?

It’s probably better to add your session_start(); to the top of your header.php file if you’re planning to use it in your theme. If you are wanting to use a session in the admin, I’d recommend either passing variables through $_GET or $_POST. Also, if you need long term storage of variables, it’s pretty easy … Read more

new post-type how do i retain the plugins on my sidebar?

The plugin would need to support custom post types. You might be able to ask the plugin developer to add that. The custom post type API’s are fairly new and still don’t have widespread support. You can see that they are adding the meta boxes only for posts and pages: add_meta_box( ‘WPPostsRateKeys-Keyword’, ‘SEOPressor Keyword’, array(&$this,’add_box_in_post_form’), … Read more

Conflict in function to allow single post template based on category

You can check for your post type single-{post-type}.php first try this: /* Define a constant path to our single template folder */ define(SINGLE_PATH, TEMPLATEPATH . ‘/single’); /* Filter the single_template with our custom function*/ add_filter(‘single_template’, ‘my_single_template’); /* Single template function which will choose our template*/ function my_single_template($single) { global $wp_query, $post; /* Checks for single … Read more

How to display this meta data (an array) in form of a function (created with a custom write panel)?

Try this? <?php function get_project_services() { global $post; $data = get_post_meta( $post->ID, ‘project’, true ); $project_services = $data[‘project_services’]; return $project_services; } ?> Then in your template file: <p><?php echo get_project_services(); ?></p> I think that will do what you’re asking? (Edited to match your comment.)