Is it possible to show thumbnails along with recent post from a wordpress blog on static website’s homepage?

Updated answer below <?php define(‘WP_USE_THEMES’, false); require(‘blog/wp-blog-header.php’); ?> <div class=”row row-60 row-sm”> <?php $args = array( ‘numberposts’ => 3, ‘post_status’=>”publish”,’post_type’=>”post”,’orderby’=>”post_date”); $postslist = get_posts( $args ); foreach ($postslist as $post) : setup_postdata($post);?> <div class=”col-sm-6 col-lg-4 wow fadeInLeft”> <!– Post Modern–> <article class=”post post-modern”><a class=”post-modern-figure” href=”https://wordpress.stackexchange.com/questions/316782/<?php the_permalink( $post->ID ); ?>” target=”_top”> <?php echo get_the_post_thumbnail( $post->ID ); ?> … Read more

How to convert feature image as background image

please use this code <?php $backgroundImg = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘full’ );?> <div class=”header-wrap” style=”background: url(‘<?php echo $backgroundImg[0]; ?>’) no-repeat;”> <header class=”entry-header”> <h1 class=”entry-title”> <?php the_title(); ?> </h1> </header>

Unable to display the post thumbnail in the loop

the_post_thumbnail displays the post thumbnail. It generates HTML tag and echoes it. It does not echo only the URL to that image. So this line: <img src=”https://wordpress.stackexchange.com/questions/324413/<?php the_post_thumbnail(); ?>” alt=”<?php the_post_thumbnail_caption() ?>”/> Generates something like this: <img src=”https://wordpress.stackexchange.com/questions/324413/<img src=”” … />” alt=”…”/> So it’s not a correct HTML. I’d changed it to: <div class=”col-12 col-sm-4″> … Read more

Get author image from corresponding article in thumbnail

<?php echo get_avatar( get_the_author_meta( ‘ID’) , 150); ?> Is exactly what I use. I think the issue is with “foreach( $recent_posts as $recent )”, I recommend using if ( $wp_query->have_posts() ) : I recommend checking out https://developer.wordpress.org/reference/classes/wp_query/ and remember to reset the loop with after your done wp_reset_postdata();

featured image metabox not moving custom post type

Hope this code may be help you. You can read the full parameters for add_meta_box in the codex. I also listed them here: add_meta_box( $id, $title, $callback, $page, $context, $priority, $callback_args ); function wpt_add_event_metaboxes() { add_meta_box( ‘wpt_events_location’, // $id ‘Event Location’, // $title ‘wpt_events_location’, // $callback ‘events’, // $page (Post Type) ‘side’, // $context ‘default’ … Read more

Change wording of default thumbnail metabox

This is usually what I go with: /** Use “Featured Image” Box As A Custom Box **/ function customposttype_image_box() { remove_meta_box(‘postimagediv’, ‘page’, ‘side’); add_meta_box(‘postimagediv’, __(‘Set Dat Image’), ‘post_thumbnail_meta_box’, ‘page’, ‘side’); } add_action(‘do_meta_boxes’, ‘customposttype_image_box’); /** Change “Featured Image” box Link Text **/ function custom_admin_post_thumbnail_html( $content ) { global $post; if($post->post_type == ‘page’) { $content = str_replace( … Read more

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