Excerpt Problems

Hopefully I’m understanding what you want correctly. I think you are going to need to wrap the content itself in a div called something like excerpt_content and make that an inline block that’s aligned to the top. Then you can use the has_post_thumbnail() as a conditional to assign it another class to limit the width … Read more

WordPress Post Format If Statement?

I believe you just need to add some “elses” into your php, like so: if ( has_post_format( ‘aside’ )) { // do some stuff } elseif ( has_post_format( ‘chat’ )) { // do some other stuff } elseif ( has_post_format( ‘gallery’ )) { // do some other stuff } else { // this isn’t a … Read more

Adding a filter to my posts

The excerpt must be used by the Theme. I don’t think it is. Use ‘the_content’ filter to append to the post. Excerpts are usually used in feeds and only by certain themes. add_filter(‘the_content’, function($content){ if(!is_archive()) return $content; global $post; // This is the current output post ob_start(); // Echo stuff to append to post here! … Read more

Excerpt is only getting shown for first post

I suspect you’re misusing query_posts(), which is always and only ever intended to modify the Primary Loop. query_posts() is meant for altering the main loop. Once you use query_posts(), your post-related global variables and template tags will be altered. Conditional tags that are called after you call query_posts() will also be altered – this may … Read more

Inserting a DIV Block Into a Listing of Excerpts?

add a counter to your loop or use a conditional statement with $wp_query->current_post, just before the ‘endwhile’, and add the div when the counter/post number reaches a certain value. please paste the full code of your template into a http://pastebin.com/ and post the link to it here, if you need more details.

How can I define the RSS feed content length?

I usualy make a RSS feed in my template. Just copy the RSS feed you have in the wp-include/feed-rss2.php Step two is registering it instead of the original: // override feeds function own_rss( $for_comments ) { //it is in my theme/feed/rss2.php $rss_template = get_stylesheet_directory() . ‘/feed/rss2.php’; if( file_exists( $rss_template ) ) { load_template( $rss_template ); … Read more

How can I add more code to this?

To insert new code you need to break php code and past your new html+/-php code. But pay attention that after passing all will have correct syntax. Your question should be made like this: <?php $my_query = new WP_Query( “cat=11&posts_per_page=1” ); if ( $my_query->have_posts() ) { while ( $my_query->have_posts() ) { $my_query->the_post(); ?> <h2><a href=”https://wordpress.stackexchange.com/questions/53008/<?php … Read more

get_posts displaying wrong permalink for “continue reading” link

You need to reset the post data after your get_posts loop since your calling setup_postdata. It would be better to remove the setup_postdata all together. global $post; $recent_posts = get_posts( $yourargshere ); foreach($recent_posts as $post) : $return = ‘<h4 class=”recent-post-title c0″>’ . $post->post_title . ‘</h4>’; $return .= ‘<p class=”recent-content c0″>’ . apply_filters( ‘the_excerpt’, $post->post_excerpt ) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)