Anyone know a php snippet for showing the first 200 characters of the most recent post?

WordPress has an inbuilt function called the_excerpt() which echoes an excerpt of the post content. By default an excerpt is 55 characters. You can set it to 200 like so: function your_excerpt_length( $length ) { return 200; } add_filter( ‘excerpt_length’, ‘your_excerpt_length’ ); This should go into your theme’s functions.php, ideally. EDIT: To manipulate the excerpt … Read more

Pagination for posts inside a specific category

Create a category-faq.php in your theme folder ( assuming category is your taxonomy and faq is the term slug ), and put your category code in there, and add pagination code to that file. This is a category specific template. For a view of what templates you can add and the types of instances they … Read more

Defining ‘last’ class on foreach blog posts

Something like this should work for you. $args = array( ‘numberposts’ => 3 ); $lastposts = get_posts( $args ); $count = 1; foreach($lastposts as $post) : setup_postdata($post); ?> <div id=”blog” class=”<?php if ($count == 3) : ?>last<?php endif; ?>”> <div class=”blog-header”><a href=”https://wordpress.stackexchange.com/questions/34591/<?php the_permalink(); ?>”> <?php the_title(); ?> </a> <div class=”date”> <?php the_date(); ?> </div> </div> … Read more

My post does not show up

You other posts are very much visible.This seems to be a strange behavior indeed.Your blog seems to be good enough performance wise. I would suggest you try to delete the post and prepare a new one . May be this must solve the problem .

Grab value of excerpt_length

You could store the length like this. function store_excerpt_length($length) { update_option( ‘excerpt_length’, $length ); return $length; } add_filter( ‘excerpt_length’, ‘store_excerpt_length’, 1000 ); Then use the following code to get the length. echo get_option( ‘excerpt_length’ );

Locally change the font family [closed]

This is not really a WordPress question but I’ll answer it anyway. The first thing you need to know is CSS is your friend. You’ll want to do something like this: In style.css .serif-class {font-family: “Times”, “Times New Roman”, serif;} Then using the html view inside of your post: <span class=”serif-class”> This is an important … Read more

Pasting formatted text from MS-Word

Maybe you can take a look at the XML-RPC function and using Microsoft Live Writer. I think this will keep all your formats in tact. Further is gives you a nice interface to work with in a desktop environment. All you have to do is enable this function in the backend, options -> write. Download … Read more