Show a featured image with “Link” Post Type?
Show a featured image with “Link” Post Type?
Show a featured image with “Link” Post Type?
Neither, they are just as fast as each other, both are using information that has already been fetched in advance. This is micro-optimising. Functions such as is_front_page or is_singular etc etc are just looking up variables already set in the main query object. Likewise functions such as has_post_thumbnail etc are looking up data that has … Read more
You can update the way image is displayed in template. in the page loop it will have something like this: <?php the_post_thumbnail(); ?> This grabs the featured image. You can wrap that in a conditional statement to check for whatever you like. This would show it in every category apart from catgory 3. <?php if … Read more
Off top of my head here’s two possible solution concepts. 1) Just run the custom loop (I meant to type, query) again and this time use it with only the_post_thumbnail. <?php if ($myposts->have_posts() ) : ?> <div class=”image-wrapper e-in”> <?php while ($myposts ->have_posts() ) : $myposts ->the_post(); ?> <div class=”image “> <!–Post Iamge Will Show … Read more
How to fetch the featured image in wordpress post[?] echo get_the_post_thumbnail( $post_id ); Or, inside a proper Loop, the_post_thumbnail(); But I have a feeling that there is information missing from the question. You aren’t using any Core functions and there is no explanation why, or reasons why not. For example, WP_Query would be far easier … Read more
Having a Child Theme is a good start; if you were to make changes to the main theme, those changes would get overwritten on a theme update. In order to solve your problem, you will need to change how the various templates work. And in order to determine which template to use, you need to … Read more
Go to wp-admin/options-media.php Set width and height to 0 for all sizes you do not want to have created.
I assume you need to show the image url to the user, for all sizes, within the Attachment Details screen. Using Underscore/Backbone We can extend the Attachment Details View, in a similar fashion as in my previous answer here and based on the media views in the core: <!– Custom template part –> <script type=”text/html” … Read more
The most simple form of the featured images (post thumbnails) looks like this: You need to have this piece of code in your functions.php file: add_theme_support( ‘post-thumbnails’ ); Then in the index.php, or any other template file you want to show the post thumb or featured images, you would add this: <?php the_post_thumbnail( ‘thumbnail’ ); … Read more
As far as I know, you can only run PHP from .php files, not .html, etc. So you should make sure you got that one right. But also you could try to use global $poster; for where you defined it and for where you are calling it. For example: in widget.php global $poster; and in … Read more