Elementor Pro display featured image on section -> style -> image using shortcode

get_the_post_thumbnail() returns the entire img tag, not just the image URL. global $post; return get_the_post_thumbnail( $post->ID ); You can also use function wp_get_attachment_url() or wp_get_attachment_thumb_url() to get image URL and insert it into the img tag. global $post; $thumbnail_id = get_post_thumbnail_id( $post->ID ); if ( false === $thumbnail_id ) return ”; $img_url = wp_get_attachment_url( $thumbnail_id … Read more

Code for unique user visit count on every page WordPress

My guess is that the user must be logged in? If that is the case you can simply store the page hits as metadata doing something like this: add_shortcode(‘pagehits’, ‘showPageHits’); function showPageHits($attributes) { /** @var \WP_Query $wp_query */ global $wp_query; $page = $wp_query->get_queried_object_id(); if (is_user_logged_in()) { $user = wp_get_current_user()->ID; $meta = get_user_meta($user, ‘pagehits’, true) ?: … Read more