Wordpress | get_user_meta in child themes php file [closed] - wordpress

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/

Related

How do I add extra fields in Dokan? [closed]

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 );

Wordpress Woocommerce shop page [closed]

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

How I can load a css file in all dashboard pages and my wp theme? [closed]

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' );

How to create custom post type item by submitting form on frontend in Wordpress [closed]

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 have a form in my Wordpress theme and I want to create custom post when I submit that form and to fill that custom post with some data from the form. What would it be? A plugin or maybe just several strings of code in functions.php? Kindly show me proper directions.
Please go to this link "insert post from frontend"
Hope the above tutorial will full fill your requirement also you can use "frontier-post" plugin to do your task.
Easiest way to do it is create a Page Template with the code to capture the form's post data. You'll also need wp_insert_post.
<?php
/**
* Template Name: My Custom Form Page
**/
?>
<?php
if(isset($_POST['my_form'])):
// do something with the data
$post = array();
$post['post_title'] = $_POST['user_title'];
$post['post_content'] = $_POST['user_content']);
$post['post_type'] = 'my_custom_post_type';
$postID = wp_insert_post($post);
endif;
// continue to template with form
?>

Change email address from Wordpress sites [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have a Wordpress site with front end login, it has the password recovery link which works fine.
The problem I have is that the password reset email that the user gets is saying it's from:
WordPress <wordpress#domain.com>
Is there a way I can change this? Possibly remove the word wordpress and/or change the actual email address it's from?
You can this data in the wp-admin panel, General tab. Change the email adress and the domain name.
It should works.
If it's not working, consider using the Send From plugin or add some filter to 'wp_mail_from' like
function use_my_email(){
return 'email#domain.com';
}
add_filter( 'wp_mail_from', 'just_use_my_email' );
and 'wp_mail_from_name'
function use_my_name(){
return 'My Real Name';
}
add_filter( 'wp_mail_from_name', 'just_use_my_email_name' );

Resources