User Defined order on get_categories?

I think the most sane way and easiest way of doing this is to unset the first value in the returned array, and then adding it back at the end of the returned array before your foreach loop For this to work, you will need to sort your categories by ID as you need to … Read more

Adding Field to Profile “Name”

check out my older article HOW TO ADD WORDPRESS AUTHOR BIO & PROFILE PAGE https://phirebase.com/blog/how-to-add-author-bio-profile-page/ just short example to add Twitter and Facebook fields: function my_new_contactmethods( $contactmethods ) { // Add Twitter $contactmethods[‘twitter’] = ‘Twitter’; //Add Facebook $contactmethods[‘facebook’] = ‘Facebook’; return $contactmethods; } add_filter(‘user_contactmethods’,’my_new_contactmethods’,10,1); Single loop <?php the_author_meta(‘facebook’); ?> – show facebook name <?php the_author_meta(‘twitter’); … Read more

Removing unnecessary wordpress files

If you don’t use any 3rd services such as XMLRPC | REST API | oEmbed | Windows Live Writer, removing those lines/headers doesn’t affect anything to your site. Those lines of code is the best way to archive what you want. To remove xmlrpc.php?rds, you need another line: remove_action(‘wp_head’, ‘rsd_link’); Put all of them in … Read more

Foreach insert query the best way

Additionally, you prepare the statement, use it, and then close it every step of the loop. That’s a lot of wasted effort. Prepare once, use for the loop, then close at the end. $event_notification = mysqli_prepare($conn, “INSERT INTO user_notifications (notification_sent_by, notification_sent_to, notification_message, notification_time, notification_status, notification_category, notification_category_id) VALUES(?,?,?,now(),?,?,?)”); foreach($datas as $data) { $id_cliente = $data[‘user_join_id’]; mysqli_stmt_bind_param($event_notification, … Read more