How to remove the excerpt in the Dzonia Lite theme
You just need to replace this line: <?php the_excerpt(); ?> With this line: <?php the_content(); ?> That should insert your post’s content instead of an excerpt.
You just need to replace this line: <?php the_excerpt(); ?> With this line: <?php the_content(); ?> That should insert your post’s content instead of an excerpt.
You may already know this, but the <b> or <strong> tags are better choices if all you want to achieve is bold text. <h1> should be reserved for the most important header(s) on your page. By default, WordPress strips out a lot of what’s in excerpts, including images and HTML tags. To undo this, you’ll … Read more
Unlike the_excerpt(), which auto-generates an excerpt from the content if one does not exist, get_the_excerpt() merely returns the contents of the post_excerpt field. Instead, use apply_filters( ‘the_excerpt’, get_the_excerpt() ), which will trigger the same processing as the_excerpt(), but return the output rather than echo it.
To show post excerpts on my tags page, you will need to make changes in content.php. By default content.php uses post excerpts for search pages only but you can modify the default behavior. This is how you can include tag pages to show post excerpts. Add || is_tag() as follows: <?php if ( is_search() || … Read more
the_excerpt() is one of a few template tags that do not accept a post ID as a parameter. Instead, you need to set up the global $post, run your tags, then restore it: if ( $_post = get_post( 10 ) ) { setup_postdata( $post = $_post ); the_excerpt(); // Any other template tags for this … Read more
There is a the_post hook which should let you modify the post object: function my_the_post_action( $post_object ) { // modify post object here } add_action( ‘the_post’, ‘my_the_post_action’ ); But the post data isn’t where your thumbnails are stored. They are associated via a post meta field. That is what you are going to have to … Read more
You’re on the right path. You can add classes to your content in the loop based on the terms assigned to each piece of work. For example, <?php if( has_term( $term, $taxonomy, $post ) ) { $work_classes=”big-item”; } ?> <div class=”<?php echo $work_classes; ?>”> … </div> This only adds the class big-item when the taxonomy … Read more
You can get the post ID from the excerpt, but as far as I can tell, WP_Query doesn’t support this (very well), so you need to write a custom WPDB query. function get_post_id_by_excerpt($excerpt) { global $wpdb; $result = $wpdb->get_row( $wpdb->prepare(“SELECT ID FROM {$wpdb->prefix}posts WHERE post_excerpt LIKE %s”, $excerpt) ); return $result; } For this to … Read more
Depending on the context, in which you would like to make these changes, I’d simply remove the metabox from that certain post type. Then add another metabox above the editor for your excerpt box. The downside: you can not use get_the_excerpt, the_excerpt etc. anymore because that metabox doesn’t exist any more. Have a look at … Read more
WordPress sets up a default filter for get_the_excerpt: wp_trim_excerpt(). It is this function that will generate an excerpt from the content “if needed”. If you don’t want this behavior, you can just unhook the filter: add_action( ‘init’, ‘wpse17478_init’ ); function wpse17478_init() { remove_filter( ‘get_the_excerpt’, ‘wp_trim_excerpt’ ); } Now get_the_excerpt() will just return the contents of … Read more