How to get url image page the right way?

Im guessing it is because you are using echo the_post_thumbnail_url(array(300, 150)); instead of the_post_thumbnail_url(array(300, 150)); the_post_thumbnail_url echos the output for you. Another observation, the the_post_thumbnail_url uses the post data that is setup using setup_postdata, so there is no need for these two lines: $thumb_id = get_post_thumbnail_id($post, ‘news-image’); $url = wp_get_attachment_thumb_url($thumb_id, ‘300, 300’);

Better way to query posts?

Since the queries are not related to each other, there is no other way around it. You are going to end with with many queries and slow page (when it is not cached) on a site with many categories. A better approch may be to show latest 50 posts, and display them by category, but … Read more

Getting the last X posts, but in ascending order of time

Have you tried the last parameter with ASC like ‘order => ‘ASC’ ? I think it will solve your problem. So your full code will be like- // get posts $posts = get_posts(array( ‘post_type’ => ‘events’, ‘posts_per_page’ => 2, ‘meta_key’ => ‘from_datetime’, ‘orderby’ => ‘meta_value’, // Here is the main trick happening. ‘order’ => ‘ASC’ … Read more

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