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.
Related
I have installed the AVADA theme's plugin Fusion Builder. System status is all ok.
but when I'm going to add a new page. It is not showing the 'use fusion builder' option.
I am done with updating the wordpress and all other plugins.
I have also tried making Fusion builder auto activation on. Still its not working.
Make sure Fusion Builder is enabled in Fusion Builder > Settings. Under Post Types, check the box next to the post types (post, page, etc.) with which you want to use Fusion Builder.
It seems that the Gutenberge Block editor may be the resons for your problem. The following code will de-register the block editor to re-solve the issue.
Please add the script to the functions.php : after_setup_theme action hook
add_action( 'after_setup_theme', 'tristup_setup' );
function tristup_setup()
{
add_filter('use_block_editor_for_post', '__return_false', 10);
// disable for post types
add_filter('use_block_editor_for_post_type', '__return_false', 10);
}
hope this will solve your problem.
I am making a wordpress store using storefront theme named Pakoutfit.com.
I tried to edit its footer credentials using My Custom Functions plugin and using this plugin I run following code,
add-action( 'init' , 'custom_remove_footer_credit' , 10 );
function custom_remove_footer_credit(){
remove_action( 'storefront_footer' , 'storefront_credit' , 20 );
add_action( 'storefront_footer' , 'custom_storefront_credit' , 20 );
}
function custom_storefront_credit(){
?>
<div class="site-info">
© PakOutfit <?php echo get_the_date( 'Y' ); ?>
</div>
<?php
}
I do that following this youtube tutorial,
Now when I tried to open my site or even its wp-admin panel it says,
This page isn’t working
pakoutfit.com is currently unable to handle this request.
HTTP ERROR 500
I dont know that in which file My custom Functions plugin make changes so that I can reverse them.
I am using godaddy domain name and hosting.
I am new in this field. Please help me to make my site live again. Thanks
Modification to your site should be made via a WordPress child theme. Do not edit core theme files: https://codex.wordpress.org/Child_Themes
Using your FTP or cPanel login, locate the file where you made the changes and remove them. That will restore your site.
Once you have your child theme installed and activated, and your function to the child theme functions.php file.
Be sure to change this:
add-action
To this:
add_action
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
I want to use the post editor of wordpress in one of the plugins I'm developing. How am I supposed to add the editor to the plugin.
Atlast I figured out a way to add the tiny-mce editor on my plugin.
You have to add a few script(s) and the post editor of wordpress will be available for you.
This is the code to use:
wp_enqueue_script( 'common' );
wp_enqueue_script( 'jquery-color' );
wp_enqueue_script('utils');
if (function_exists('add_thickbox')) add_thickbox();
wp_print_scripts('media-upload');
if (function_exists('wp_tiny_mce')) wp_tiny_mce();
wp_admin_css();
wp_print_scripts('editor');
do_action("admin_print_styles-post-php");
do_action('admin_print_styles');
It's enough to add the tiny mce editor on your plugin.
Now the following line is necessary to display the editor: