I am making a wordpress theme
But the problem is i can not enable feature image option in Portfolio
I have added the following code in the function.php
add_theme_support( "post-thumbnails", array('portfolio', 'post'));
This code is working for posts but not for portfolio
is it because of any of these plugins that i am using
Advanced Custom Fields
Custom Post Type UI
Akismet
enter image description here
try this in fucntion.php file
function custom_theme_setup() {
add_theme_support( 'post-thumbnails', array('post', 'page', 'popup') );
}
add_action( 'after_setup_theme', 'custom_theme_setup');
Related
I using wordpress and woocommerce plugin and added custom html button on product page. I did it in function.php file. How can i get PDF file with photo content from every product page after click on my button?
add_action( 'woocommerce_after_single_product_summary', 'custom_button_on_product_page' );
function custom_button_on_product_page() {
global $product;
echo '<button class="send_button">SEND PDF</button>';
}
function enqueue_jspdf() {
wp_enqueue_script( 'jspdf', 'https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js', array(), '2.5.1', true );
}
add_action( 'wp_enqueue_scripts', 'enqueue_jspdf' );
How can i do it? Help please. I tried add jsPDF library in function.php too and paste javascript code in code snippet. But i don't now how to hook on my code to photo content in product page. Great thanks for your answers
I have a website where product gallery is not working on product detail page, I have tried to add third party plugin but nothing seems to working.
Here when you click on product image, it should open in lightbox as product gallery.
https://bosheimsmarken.no/produkt/reinrot-te-med-tea-shotnon-binding-subscriptions/
Try to install this plugin and check if there is option to disable this gallery in theme options or woocommerce options.
Product Gallery Slider for Woocommerce by codeixer
Also add this code in your functions.php in active theme
add_action( 'after_setup_theme', 'bbloomer_remove_zoom_lightbox_theme_support', 99 );
function bbloomer_remove_zoom_lightbox_theme_support() {
remove_theme_support( 'wc-product-gallery-zoom' );
remove_theme_support( 'wc-product-gallery-lightbox' );
remove_theme_support( 'wc-product-gallery-slider' );
}
Currently I'm making new theme and had the idea of adding featured image in the admin side of wordpress, unfortunately its not working this is what I have tried
I have added this code in functions.php
add_theme_support( 'post-thumbnails');
I also tried to change it
add_theme_support( 'post-thumbnails', array( 'post' ) ); // Add it for posts
add_theme_support( 'post-thumbnails', array( 'page' ) ); // Add it for pages
After I refresh and log in to my admin panel and tried to create new post or page featured image is not displaying.
I also tried deactivating my custom theme and activating Twenty Fifteen the featured images shows but if I activate my custom theme again the featured image is gone again.
I also have tried to look at SCREEN OPTIONS but I don't have any available checkbox related to featured image, please help me.
Can someone help or guide me what to do this because I'm new to this?
you can try to tie your add_theme_support call to WP action, for example after_setup_theme.
Here's sample code for this:
add_action('after_setup_theme', 'themename_post_thumbs_en', 11);
function themename_post_thumbs_en() {
add_theme_support('post-thumbnails', array('post', 'page'));
}
my search result doesn't show excerpt content of pages on WordPress it only show for the post
advise please
Taken from http://codex.wordpress.org/Function_Reference/add_post_type_support
<?php
add_action('init', 'my_custom_init');
function my_custom_init() {
add_post_type_support( 'page', 'excerpt' );
}
?>
Adds excerpt support for the 'Page' post type. Paste this code into your themes functions.php file (ref http://codex.wordpress.org/Functions_File_Explained)
I am trying the following syntax to add the custom menu on dashboard. and I put this code in 'function.php' in theme folder file. but its not displaying menu on dashboard. So, please help me in which file I put this code? otherwise any other solution please help me.
<?php
add_action( 'admin_menu', 'register_my_custom_menu_page' );
function register_my_custom_menu_page(){
add_menu_page( 'custom menu title', 'custom menu', 'manage_options', 'custompage', 'my_custom_menu_page', plugins_url( 'myplugin/images/icon.png' ), 6 );
}
function my_custom_menu_page(){
echo "Admin Page Test";
}
?>
In which function.php file are you writing this code? are you writing in the core files? if you are writing in the theme's function file just make sure that the theme is currently active.