Find a way to retrive data updated through metabox plugin to web page

So finally I found a way to do that. Here is the code. page-contact.php <!– Contact Info –> <div class=”contact-info col-md-4 col-sm-4 margin-top-20 padding-left-20″> <label class=”contact-label pull-left width-wide”>Contact Info</label> <p><strong>IT’S SHOWTIME TOWING</strong><br /><br /> <!–Phone: <a href=”https://wordpress.stackexchange.com/questions/355497/tel:0450749863″>0450749863</a><br /><br /> –> Phone: <a href=”https://wordpress.stackexchange.com/questions/355497/tel:0450749863″><?php echo get_post_meta( $post->ID, ‘telNo’, true );?></a><br /><br /> <!–Email: <a href=”mailto:[email protected]”>[email protected]</a><br /><br … Read more

Custom array from a query only write the last row of the query

This is because you’re not adding elements to the array. You’re overwriting them: $modified_result = array(); foreach($queryresult as $result){ $modified_result[‘name’] = $result->name; $modified_result[‘address’] = $result->address; } Your loop is setting the name and address property of the $modified_result array directly, and then replacing them for each item in the loop. You want $modified_result to be … Read more

List taxonomy term slugs within shortcode (do_shortcode)

The do_shortcode() function is currently in the foreach loop. I don’t know what are the parameters of this shortcode , but if it accepts comma separated values of term slugs: $terms = get_the_terms( $post->ID , ‘shoptype’ ); $i=1; $commaSeparatedvalues=””; foreach ( $terms as $term ) { $term_link = get_term_link( $term, ‘shoptype’ ); if( is_wp_error( $term_link … Read more

Where does “rel=0” get removed from my YouTube parameters?

Iframe content is generated by youtube itself, wordpress just requests it via oembed call. If you wish you can study wp-includes/class-oembed.php code, but that will not help you to change iframe parameters. For that you may apply embed_oembed_html filter, see https://developer.wordpress.org/reference/hooks/embed_oembed_html/. It receives iframe html code, so you can do some string replacements to change … Read more

How to set up a If is_singular statement?

is_single() and is_singular() are not the correct functions to use here. Your comment mentions that this is being added to search.php, but is_single() and is_singular() will always be false on search.php, because those functions are checking if the current page is a single post or page, but search.php is not. It’s is a list of … Read more

Started getting warning message following host’s PHP upgrade

The issue is this line: if(function_exists(register_setting)) register_setting is not in quotes. Values without quotes are how you refer to constants in PHP, but there’s no constant with that name, because it’s supposed to be ‘register_setting’, with quotes. PHP recognises this mistake, and is interpreting this as if you had included the quotes, but it’s warning … Read more

Warning message (re. php) on the blog page

<a href=”https://wordpress.stackexchange.com/questions/364537/<?php//echo esc_url( home_url(“https://wordpress.stackexchange.com/” ) ); ?>”><?php// bloginfo( ‘description’ ); ?></a> The <?php// is the problem. PHP blocks are started with <?php but the code uses <?php//. Instead, change it to <?php //, or better yet, since // is meant to comment an entire line out, use /* */ style commenting instead

Notify users only on post publish

You could use the transition_post_status hook instead, as it already knows what the current and previous status of the post are. <?php add_action(‘transition_post_status’, ‘wpse_366380_email_on_publish’, 10, 3); function wpse_366380_email_on_publish( $new_status, $old_status, $post ) { // Only if this post was just published, and previously it was either // “auto-draft” (brand new) or “pending” (not yet published) … Read more