Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've made websites from scratch using bootstrap and websites using wordpress but now I want to make an e-commerce website using wordpress and woocommerce but I also want to utilise bootrap's commands for responsiveness. How can I integrate bootstrap into my wordpress theme that I am creating?
In your theme/child-theme functions.php file you should enqueue your css and javascript files.
For example:
function theme_enqueue_styles() {
wp_enqueue_style( 'bootstrap-theme-style', '/wp-content/themes/' . get_stylesheet() . '/assets/css/bootstrap.min.css' );
wp_enqueue_script( 'bootstrap-min-script', '/wp-content/themes/' . get_stylesheet() . '/assets/js/bootstrap.min.js', array(), true );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
Just add the bootstrap styles and javascript to the theme header and then use the responsive classes described in:
http://getbootstrap.com/css/#responsive-utilities
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 months ago.
Improve this question
function med_scripts() {
wp_enqueue_script('BOOT-js', get_template_directory_uri() . '/assets/js/main.js', array(), "0.1", true);
}
add_action('wp_enqueue_scripts','med_scripts');
Your code is working correctly. I tested it on my development site. You need to create a main.js file in the js folder if main.js does not exist. If you write custom code for jQuery, please pass jquery in the array. for example:
function med_scripts() {
wp_enqueue_script('BOOT-js', get_template_directory_uri() . '/assets/js/main.js', array( 'jquery' ), "0.1", true);
}
add_action('wp_enqueue_scripts','med_scripts');
Screenshot
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm trying to get the user meta in a file calles "print.php" in my child-theme folder:
define( 'WP_USE_THEMES', true );
$userid = $_GET['id'];
//$all_meta = get_user_meta( $userid );
When I call "get_user_meta()" i get an Error 500.
I already tried with
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
and
define('WP_USE_THEMES', false);
require('./wp-load.php');
What am I doing wrong and how can I resolve it?
Also tried already to put a function in my functions.php and call this function. No luck.
I hope you can help me.
Thanks and best regards,
Niko
You must include the wp_head() Function on top of your index.php / function.php. So that you can use WordPress Funktions. See the documentation here
https://developer.wordpress.org/reference/functions/wp_head/
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
Good Day.
I am developing a multivendor website for my client and I used Dokan. My client would like his vendors to add a (Sample Product Price) and (Bulk Product Price).
Is there any way to add those fields?
He also would like his vendors to add custom tags to their products.
Regards,
Go to dokan plugin directory. then go to the below path
1) templates/products/new-product-single.php
2) templates/products/new-product.php
You can override the new-product.php and new-product-single.php file in your child theme and then add your field. However, there are some other steps required to successfully save them.
These below hooks to save and update the field data.
do_action( 'dokan_new_product_added', $product_id, $post_data );
do_action( 'dokan_product_updated', $post_id );
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I need help adding VIEW and ADD button into my Woocommerce Shop page. Do you have any plugins or codes that I can add into my functions.php?
You can try this code to add add to cart and view button in shop page
//// to add cart buttton
function add_cart_to_shop () {
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 10 );
}
add_action( 'after_setup_theme', 'add_cart_to_shop' );
//// to add view buttton
function add_view_to_shop() {
echo 'View';
}
add_action( 'woocommerce_after_shop_loop_item', 'add_view_to_shop', 8 );
Try this then let me know the result.
You need css code to design it yourself.
Thanks
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
How I can load a css file in all dashboard pages and my WP theme with wp_enqueue_style?
My CMS is WordPress.
put this into you functions.php, also make sure to create the .css file in the correct spot. here is the link to the codex
function load_custom_wp_admin_style() {
wp_register_style( 'custom_wp_admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
wp_enqueue_style( 'custom_wp_admin_css' );
}
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );