wp_get_archives() output

The date.php, archive.php, and index.php files control the date archive output. You need to check the contents of those files, in respective order, to find the problem. If WordPress can’t find date.php, it will check for archive.php, and load that if found. Otherwise, index.php will be used to display date archives. See my answer on … Read more

Echo post title in post

Use the_title(): function add_post_content($content) { if(!is_feed() && !is_home()) { $content = the_title( ‘<p>’, ‘</p>’, FALSE ) . $content; } return $content; } add_filter(‘the_content’, ‘add_post_content’); The first two arguments are for $vefore and $after. If a post doesn’t have a title, you get not extra markup. The last argument makes the function returning the string. Otherwise … Read more

Shortcode of a function

Build a string instead of directly outputting the contents. $str=””; foreach ($postslist as $post) : setup_postdata($post); $str .= ‘<div class=”events”>’; $str .= ‘<p><strong>’.get_the_date().'</strong></p>’; $str .= ‘<p><a href=”‘.get_permalink().'” title=”‘.esc_attr(get_the_title()).'”>’.get_the_title().'</a></p>’; $str .= ‘</div>’; endforeach;

Why is this function crashing my wordpress installation? [closed]

First, be sure to enable WP_DEBUG in your wp-config.php file, so that you can see fatal error messages. In this case, the problem is that you’ve named your function load_wforms(), but you reference the callback wforms in your add_action() call: function load_wforms() {} …vs… add_action(‘init’, ‘wforms’); The second parameter, wforms, refers to a function named … Read more