Update only some custom user fields

I have found the solution do_action(‘edit_user_profile_update’, $current_user->ID); was the problem. After I commented it out the update went fine. do_action is a plugin hook and expected way more that the from gave: explanation

uploading a new theme to live server

As I have written in your post at StackOverflow board: Please look at Upload localhost changes to live server If you are only making file changes, you should copy the live site and set it up on a local wordpress server. On the local wordpress server, just edit the theme as you like, and when … Read more

‘posts_per_page’ in costum page type

0 isn’t a valid value for posts_per_page. WordPress will see it as empty and default to the posts_per_page option. If you want all the posts use nopaging or posts_per_page => -1. $query = new \WP_Query([ ‘post_type’ => ‘producenter’, ‘nopaging’ => true, ‘orderby’ => ‘rand’, ‘post__not_in’ => [$post->ID], ]); As far as why it’s only showing … Read more

Can form entries from a WordPress form go to a database

WordPress supports Custom Post types, because this isn’t just about the form, but about displaying the data and making it searchable by other users – https://codex.wordpress.org/Post_Types I would recommend you look up http://pods.io/ which would help create these custom post types also build relationships between two post types (or Pods as they call it). Also … Read more

Trying send mail from Theme page

If you assign wp_mail() to a variable you can echo the results. Should return either true or false. $email = wp_mail(email,subject,message); var_dump($email); I don’t recognise the send_message() function in your code.

How do I display Category titles on a WP Page?

I believe you want wp_list_categories (). With a short set of arguments you should be able to get the results you want, including excluding “uncategorized”. Something like: $args = array( ‘exclude’ => 1, ); wp_list_categories( $args );

Using catch_that_image() for galleries?

The gallery is a shortcode, so you will need to parse the shortcode to grab the image referenced therein: function pull_image_from_gallery(){ global $post; $pattern = get_shortcode_regex(); preg_match_all( “https://wordpress.stackexchange.com/”. $pattern .’/s’, $post->post_content, $matches ); foreach ($matches[2] as $k=>$v) { if (‘gallery’ == $v) { $atts = shortcode_parse_atts($matches[3][$k]); if (!empty($atts[‘ids’])) { $ids = explode(‘,’,$atts[‘ids’]); $first = $ids[0]; … Read more

Use html tags in shortcode_atts, is it real?

While it is a technically possibility, it’s most likely direction that isn’t worth it. Overuse of shortcodes for what is essentially (crappy) templating is problematic and has a history of security issues. In recent months there has been ongoing planning and discussion about possibility of changes to shortocde syntax and mechanics in core. HTML in … Read more

PHP Shortcode – 500 error

Like @s_ha_dum said, those nightmarish “template tag” style conditionals made it hard to find those errors. Please use define( ‘WP_DEBUG’, true ); in your wp-config file to print those PHP errors while you are developing. function lande_galleri_parameter($atts) { extract( shortcode_atts( array ( ‘post_type’ => ’embm_beer’, ‘order’ =>’date’, ‘orderby’ => ‘title’, ‘posts’ => -1, ‘land’ => … Read more