Global $wpdb is not showing correct data with function call

With @Jacob Peattie suggestion, I have recoded it & it is working perfectly fine with functions. /* Recent updated post & pages */ if ( ! function_exists( ‘iq_recent_update’ ) ) : function iq_recent_update() { $orig_post = $post; global $post; $args=array( ‘posts_per_page’ => 3, ‘orderby’ => ‘modified’, ‘order’ => ‘DESC’, ‘post_type’ => array(‘post’, ‘page’), ‘post_status’ => … Read more

Get .subsubsub count of post per status queried using pre_get_posts

Ah! jQuery to the rescue! function custom_admin_js() { global $get_all_statuses; ?> <script type=”text/javascript”> jQuery(document).ready(function($) { //Bring my $get_all_statuses array and encode it for jquery var myObjects = <?php echo json_encode($get_all_statuses);?>; //Run a each loop : jquery equivalent to php’s foreach $.each(myObjects, function (index, value) { //console.log(index); //Status Label //console.log(index); //Status-name //count the WP list rows … Read more

How to update a row in a table in WordPress

pull form closing tag inside foreach loop <?php foreach ($get_data as $infocontact) { echo ‘<form class=”form-info-wmtp” action=”” method=”post” enctype=”multipart/form-data”>’; echo ‘<input type=”hidden” name=”id_image” id=”id_image” value=”‘.$infocontact->id.'” />’; echo ‘<div class=”txt-info-wmtp”>’.$infocontact->button_name.'<p><input type=”text” value=”‘.$infocontact->link_button.'” name=”link_button” placeholder=”Enter the link button”>’; echo ‘<input type=”submit” id=”btnSubmitSocial” name=”btnSubmitSocial” value=”Update”>’; echo ‘<input type=”submit” id=”delete-btn” name=”btnDelete” value=”Delete”></p></div>’; //i pull /form inside loop here echo … Read more

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