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

wp_nav_menu doesn’t work in a duplicate server

The menu data is in the database. In order to have an exact copy, you need to copy the files and all the items in the database as well. Verify if all the needed elements from the database are present in the wordpress admin and or with phpmyadmin. Alternatively, after these lines in your PHP … Read more

Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING

I found the solution by logging into the site FTP, renaming my WP site’s index.php to index.php_, and supplying this code in a new index.php file: <!DOCTYPE html> <html> <body> <?php $servername = “xxx.xxx.xxx.xxx”; $username = “xxxxx”; $password = “xxxxx”; try { $conn = new PDO(“mysql:host=$servername;dbname=xxxxxx”, $username, $password); // set the PDO error mode to … Read more