Using the_excerpt() on a page

While this was far from clear in the OP at first, I think this might be a good solution. Just make a shortcode to place the excerpt in the body. (This is a bad idea if you want this on every page. This is a good idea if you want it once in a while … Read more

Where is wp() function definition?

Just follow the code :). Before calling wp(), /wp-blog-header.php loads /wp-load.php (which assuming you have correctly installed WordPress) loads /wp-config.php. At the bottom of that file, it calls /wp-settings.php. This file loads a lot of other files, initialising the core parts of WordPress. Amongst them, is the wp-includes/functions.php file. It’s inside this file that wp() … Read more

Display WordPress Post Content in 3 Columns

Query the posts like you are known to it, but then get all posts and restructure them for the order you need it. Take care of setting up the global $post variable your own so that to ensure you template code still works. The array_chunk­Docs function normally comes in handy for column based output: $query … Read more

Adding Meta Tags to a Post using its Tags, Excerpt and content

I would keep out of your header.php & either add the following to your functions.php or wrap up as a plugin: add_action( ‘wp_head’, ‘wpse_71766_seo’ ); /** * Add meta description & keywords for single posts. */ function wpse_71766_seo() { if ( is_single() && $post_id = get_queried_object_id() ) { if ( ! $description = get_post_field( ‘post_excerpt’, … Read more

Get URL from shortcode tag

There’s no need to use regex for this. WordPress has a Shortcode API to do this work for you. That codex page includes one of my favorite codex code snippets: function bartag_func( $atts ) { extract( shortcode_atts( array( ‘foo’ => ‘something’, ‘bar’ => ‘something else’, ), $atts ) ); … Right at the start of … Read more

Limit checklist by the current user

Use the same technique as $checked: $disabled = ( $ed->ID != get_current_user_id() ) ? ‘ disabled=”disabled”‘ : ”; your code: foreach ($alleds as $ed) { $checked = (in_array($ed->ID,(array)$currenteds)) ? ‘ checked=”checked”‘ : ”; $disabled = ( $ed->ID != get_current_user_id() ) ? ‘ disabled=”disabled”‘ : ”; echo ‘<input type=”checkbox” name=”currenteds[]” value=”‘ . $ed->ID . ‘”‘ . … Read more

WooCommerce Tabs [closed]

Yup, there’s a filter for it: woocommerce_settings_tabs_array: add_filter( ‘woocommerce_settings_tabs_array’, ‘wpse94969_settings_tabs_array’ ); function wpse94969_settings_tabs_array($tabs){ $tabs[‘catalog’] = __(‘Products’,’your_textdomain’); // or whatever you fancy return $tabs; } This will take care about the tab title itself: The word “Catalog” appears again in two field labels below though. To change these you can take advantage of the woocommerce_catalog_settings filter: … Read more