Conversation
supportHi, I’m trying to create short code to use in the wordpress admin content editors. Not sure if I’m using the correct row in the db, and I can’t find anything in your documentation showing where the data is inserted in wpdb. So far I have this, but it’s not working: $results = $wpdb->get_row($sql,ARRAY_A); $surfschool_name = $results['display_name']; $surfschool_email = $results['user_email']; $surfschool_logo = $results['author_image']; Then I’m using an array like this: array( 'surfschool' => $surfschool_name, 'surfschoolemail' => $surfschool_email, 'surfschoollogo' => $surfschool_logo ) Both [surf school] and [surfschoolemail] work perfectly as short code but [surfschoollogo] does not. Have you got any suggestions? Thanks https://wordpress.org/plugins/sem-author-image/
The plugin does not use the database for the image location. Instead it uses a uses a folder in wp-content and checks for the existance of an image file for the given author.
Actually it does, I worked it out. This returns the file name. $sql_author_image = "SELECT meta_value FROM wp_usermeta WHERE user_id = $user_id AND meta_key = 'author_image' "; $author_image = $wpdb->get_var($sql_author_image); Then all you have to do is create an add_shortcode function.
4.9 version supports [author-image] shortcode for displaying in th epost/page content.
The plugin does not use the database for the image location. Instead it uses a uses a folder in wp-content and checks for the existance of an image file for the given author.
Actually it does, I worked it out. This returns the file name. $sql_author_image = "SELECT meta_value FROM wp_usermeta WHERE user_id = $user_id AND meta_key = 'author_image' "; $author_image = $wpdb->get_var($sql_author_image); Then all you have to do is create an add_shortcode function.
4.9 version supports [author-image] shortcode for displaying in th epost/page content.