iversoncru
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Images are not showing in my blogi think we can make the topic Resolved
Forum: Fixing WordPress
In reply to: No image showing in single postSure!! thanks again
Forum: Fixing WordPress
In reply to: Images are not showing in my blogI have figure out sth different to do the same thing.
<article> <?php $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $args = array( 'posts_per_page' => 2, 'cat' => 7, 'paged' => $paged, ); $wp_query->query( $args ); while ( $wp_query->have_posts() ) : $wp_query->the_post(); $post_id = get_the_ID(); ?> <?php $title = get_the_title(); if (strlen($title) > 20) { $title = substr($title, 0, 18) . '...'; } ?> <h2><a href="<?php the_permalink(); ?>"><?php echo $title; ?></a> <?php the_time('F jS, Y') ?></h2> <?php the_post_thumbnail('thumbnail');?> <p> <?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,56); ?> </p> <p class="read_more">Read the full post <a href="<?php the_permalink(); ?>">here</a></p> <?php endwhile; $page_navi = function_exists('wp_pagenavi') ? true : false ; ($page_navi) ? wp_pagenavi() : posts_nav_link(); ?> <?php wp_reset_postdata(); ?> <?php $wp_query = null; $wp_query = $temp; ?> </article>
to use the_post_thumbnail(), i had to add to my functions.php:
add_theme_support( ‘post-thumbnails’ );And change the way to attach images to the posts: inside the post, click no “Set featured image”.
I hope it helps ?? this is where i took it from… https://www.ads-software.com/support/topic/no-image-showing-in-single-post?replies=5
Forum: Fixing WordPress
In reply to: No image showing in single postThanks a lot CarletonU for your answer and your time.
For the first price of code…
I had already added the line:
add_theme_support( ‘post-thumbnails’ );But i kept attaching the image from the Media Library. Now i do as you said, and it is working!
Thanksssssssssssssss a looooot
Forum: Fixing WordPress
In reply to: No image showing in single posti have also tried this code
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <?php echo $post_id = get_the_ID();?> <h2><?php the_title(); ?></h2> <h3><?php the_time('F jS, Y') ?></h3> <?php echo wp_get_attachment_image($post_id, 'full');?> <p><?php the_content(); ?></p> <?php endwhile; ?> <nav> <?php previous_post_link('%link', '< Previous ' , in_same_cat, 'excluded_categories'); ?> <?php next_post_link('%link', ' Next > ', in_same_cat, 'excluded_categories'); ?> </nav>
Forum: Fixing WordPress
In reply to: No image showing in single postthe images were attached to the posts from the Media Library. This means:
I created a post and published it.
Then i went to the Media Library and Add a new image.
From the Media Library i clicked “attach” to attach the image to the post.I dont know whats happening, i was supposed to be easy o.O
Forum: Fixing WordPress
In reply to: Images are not showing in my blogoh, i see!! thanks a lot for the explanation.
by the way, since the image is in the Media library, i attach it to the post, and everything works perfect!!
Thankssssssssss
Forum: Fixing WordPress
In reply to: Images are not showing in my blogYou are right, frizax.
When i went to the Media Library, there is no image attached to the post, but my doubt now is:
I could attached the image when i created the post, and i still can see it. When i preview the post, i see the image as well, but it is not in the media library.
What is happening?Forum: Fixing WordPress
In reply to: Images are not showing in my bloghi! thanks a lot for your answers and your time.
frizax, I have done your suggested debugging and in the sencond one, it says ’empty’.
But i have an image attached to the post (attached when i created the post in WP admin panel), and actually i can see it when i see the single post.
weird :SForum: Fixing WordPress
In reply to: Images are not showing in my blogmaybe i can use also some advice. This is the first time i try to do a blog, and im not sure if i did right using query(), for example.
Forum: Fixing WordPress
In reply to: Show posts by a category not workingkeesiemeijer, thanks a lot, that works perfectly.
Anyway, I was checking other posts, and i found this, which helped, although it does not use wp_query.<article> <?php $args = array( 'cat' => 7, 'posts_per_page' => 5, 'paged' => $paged ); query_posts($args); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <div class="post"> <h2><a href="<?php the_permalink(); ?>" title="Read more"><?php the_title(); ?></a></h2> <p><?php echo substr(get_the_excerpt(), 0,300); ?></p> </div> <?php endwhile; ?> <?php if ($paged > 1) { ?> <nav id="nav-posts"> <div><?php next_posts_link(' Previous'); ?></div> <div><?php previous_posts_link('Next'); ?></div> </nav> <?php } else { ?> <nav id="nav-posts"> <div><?php next_posts_link('Previous '); ?></div> </nav> <?php } ?> <?php wp_reset_postdata(); ?> </article>
Forum: Plugins
In reply to: [Slideshow] Customize arrowsthanks a lot for this post and for the answer.
I did what you said, Stefan, and it is working perfectly and exactly how i wanted.
Thanks a lot!!Forum: Plugins
In reply to: [Plugin: Events Manager] Show events in post category and tag cloud widgetsI would like to solve that as well, exactly the same.
Would anyone answer? ;(