How to echo a PHP Code After the Content

You can try my approach which is used to do your requirement: function themename_your_content_after($content) { if( is_single() ): ob_start(); ?> <div class=”css”> <?php if ( should_display_link() ) : ?> [subscribe-author-button] <?php echo ‘<a class=”btn” style=”background-color:#1f1fff; border-radius:100px;” href=”‘.site_url(‘chat/’).’?new-message&to=’.get_the_author_meta( ‘user_login’ ).'”>Chat</a>’ ; ?> <?php endif; ?> [simple-author-box] <?php if ($post->post_status == “publish”) { ?> <h4>[post-views]</h4> <?php } … Read more

Display html code, not the tags

You need to remove the esc_html(). The whole purpose of that function is to prevent text being interpreted as HTML. do_shortcode( wpautop( $sectionData[‘left-content’] ) );

Unable to insert current username into custom table through html form

wp_get_current_user returns a WP_User object. You’ll need to pull the name out of that in order to send it try $current_user->display_name in your insert statement. On that note, you should absolutely not be inserting unsanitized user entered data into your database. Please look into SQL injection and input sanitization.

Images with overlay

I was able to find some jQuery that helped solve the issue: $( “.alignright” ).parent().addClass( “alignright” ); $( “.alignleft” ).parent().addClass( “alignleft” ); $( “.aligncenter” ).parent().addClass( “aligncenter” ); This small piece of code finds alignright, alignleft, and aligncenter then adds those classes to the “parent” container, which is the containing element that those classes are applied … Read more

sessionStorage saves input value in browser but it is not loaded in the form field

You are using innerHTML for every field. Input field shouldn’t be using .innerHTML use .value instead and for select you should loop through the options not use .innerHTML window.onload = function() { var quote_price_input = sessionStorage.getItem(“quote_price_input”); var message_to_customer = sessionStorage.getItem(“message_to_customer”); var select_price_option = sessionStorage.getItem(“select_price_option”); if(quote_price_input !== null) { document.getElementById(‘quote_price_input’).value = quote_price_input; } else document.getElementById(‘quote_price_input’).value = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)