Adding a post shortcode to a page template?

To use shortcode in a PHP file (outside the post editor) you have the handy little function do_shortcode(); so in your case you use: <?php do_shortcode(‘[mingleforum]’); ?> Update: following the first comment, I figured its publicly known for some reason, if you are expecting output from the shortcode then echo it out. <?php echo do_shortcode(‘[mingleforum]’); … Read more

How to limit 1 image per post on homepage only?

/** * @author: wpreceipes * @link: [1]: http://www.wprecipes.com/how-to-get-the-first-image-from-the-post-and-display-it */ function wpse18215_catch_that_image() { global $post, $posts; $first_img = ”; ob_start(); ob_end_clean(); $output = preg_match_all( ‘/<img.+src=[\'”]([^\'”]+)[\'”].*>/i’, $post->post_content, $matches ); $first_img = $matches[1][0]; //Defines a default image if( empty( $first_img ) ) { $first_img = ‘/images/default.jpg’; } return $first_img; } Example: echo catch_that_image(); or: /** * @author: Marcelo … Read more

Can’t find plugins in menu for wordpress 3.2?

$menu_perms = get_site_option( ‘menu_items’, array() ); if ( ! is_multisite() || is_super_admin() || ! empty( $menu_perms[‘plugins’] ) ) { $count=””; if ( ! is_multisite() && current_user_can( ‘update_plugins’ ) ) $count = “<span class=”update-plugins count-$plugin_update_count”><span class=”plugin-count”>” . number_format_i18n($plugin_update_count) . “</span></span>”; $menu[65] = array( sprintf( __(‘Plugins %s’), $count ), ‘activate_plugins’, ‘plugins.php’, ”, ‘menu-top menu-icon-plugins’, ‘menu-plugins’, ‘div’ ); … Read more