I am converting an HTML site to WordPress. In my new theme I have no option for a featured image. How can I enable this option?
Use
add_theme_support( 'post-thumbnails' );
in your function.php
Related
I'm creating a website with wordpress but I cannot see featured image in both screen options or editor
This is blank Wordpress install 5.3.2, I develop new web from scratch so I don't think problem related to other plugins
Go into your themes functions.php and paste the following code inside:
add_theme_support( 'post-thumbnails' );
Reference: https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
Hope you can use it to solve your problem.
I added a featured image to my custom post type and it appears correctly on the front-end, but on the custom post type the featured image thumbnail doesn't show up at all.
As you can see, the Remove featured image button is read, but the thumbnail is not available. I used the_post_thumbnail() in my PHP code to display the featured image, which works correctly, but I don't know why the thumbnail missing. Anyone know why this is happening?
Thanks!
just add below code to your active theme's function.php
add_action( 'after_setup_theme', 'custom_featured_image_backend' );
function custom_featured_image_backend() {
add_theme_support( 'post-thumbnails','your_custom_post_type_name');
}
I am using the Visual Composer plugin on Wordpress. On the Featured Products (Woocommerce) element, is it possible to add a short description underneath the Product Title? would this best be done in functions.php?
The website is using a theme where a child theme has not been created and I'm not sure how much of the theme has been changed/edited. I don't want to edit the theme files!!
Many thanks
Yes You can. Just paste this lines of code into your theme's woocommerce/content-product.php file right after this line
do_action( 'woocommerce_shop_loop_item_title' );
global $product;
if ( $product->is_featured() ) {
echo apply_filters( 'woocommerce_short_description', $post->post_excerpt
);
}
I have a shop website with woocommerce 3.0.3 and on product detail page using default woocommerce templates, there is an issue with lightbox about clicking on the main image or gallery images. The site redirects me to a page with the image link instead of showing the lightbox.
You just need to add these lines in your function.php file and your lightbox (photoswipe) will work absolutely fine.
if(class_exists('WooCommerce')){
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
}
Hope this helps
I found the solution. In latest version woocommerce-3.0.3, lightbox is replaced with photosswipe. Photoswipe is disabled in my theme. It works only if the theme add support like add_theme_support('wc-product-gallery-lightbox') then it works like a charm
The problem is not only the missing add_theme_support('wc-product-gallery-lightbox')
If the DOM structure is not the same as the updated files: product-thumbnail.php and product-image.php - then the add_theme_support function won't help you.
Copy these files from WooCommerce plugin to your theme, and it should work.
I have create an plugin, it's featured image option working in wordpress default theme(twenty thirteen/forteen ) but not working others themes.
Any Idea ?
Themes have to declare their support for post thumbnails before the
interface for assigning these images will appear on the Edit Post and
Edit Page screens. They do this by putting the following in their
functions.php file:
add_theme_support( 'post-thumbnails' );
Source: http://codex.wordpress.org/Post_Thumbnails#Enabling_Support_for_Post_Thumbnails