get USER ID in functions.php using user_register action

You are giving $wpdb->get_results a string for its second parameter. It should be a constant– ARRAY_N— meaning you need to remove the quotes $getunion = $wpdb->get_results( “SELECT value from wp_bp_xprofile_data where user_id = $getid AND field_id = 4”, ARRAY_N ); Since you claim it works in the second instance, I am assuming $wpdb compensates, but … Read more

Display 1 category only with get_the_category (by ID or slug)

I think you could do something like this: $categories = get_the_category(); $displayed_category_id = 1; // set this to the category ID you want to show $output=””; if($categories){ foreach($categories as $category) { if ( $displayed_category_id == $category->term_id) { $output .= ‘<a href=”‘.get_category_link($category->term_id ).'” title=”‘ . esc_attr( sprintf( __( “View all posts in %s” ), $category->name ) … Read more

unused post IDs

You can stop WP creating revisions by adding the following to your wp-config.php: define(‘WP_POST_REVISIONS’, false ); You can replace false with an integer if you just want to restrict the number a maximum number of revisions. If you check the plugin directory you’ll find several that will clean up old revisions, such as this one. … Read more

Create hundreds of users with just ID in phpMyAdmin

To change the initial ID user by mysql ALTER TABLE wp_users AUTO_INCREMENT=2; although the number has to start at the next available id with no existing id higher, as in select max(id) from wp_users; https://stackoverflow.com/questions/1485668/how-to-set-initial-value-and-auto-increment-in-mysql

User registration add user ID?

You can’t add the ID at registration because there is no ID until after the user has registered. (See a possible way around this near the bottom). You could tack on the ID after the registration with the user_register hook. function add_ID_wpse_99390($a) { global $wpdb; $user = new WP_User($a); $wpdb->query(“UPDATE {$wpdb->users} SET user_login = CONCAT(user_login,’_’,ID) … Read more

Using class id from array for query

Try this after your $wpdb query: // collect calendar id’s $ids = array(); foreach( $calendar_entries as $calendar_entries): array_push( $ids, $calendar_entries->id ); endforeach; // query the above calendar id’s $args = array( ‘post_type’ => ‘post’, ‘post__in’ => $ids, ‘orderby’ => ‘id’, ‘order’ => ‘DESC’ ); $query = new WP_Query( $args ); You can also modify the … Read more

get id custom tables on current page

I am not sure that I understand the question but if $bab->id is the ID in the $wpdb->post table then get_permalink($bab->id); will give you the permalink for the page. If you are trying to get the ID of the page after you click those links, try: echo $post->ID; // or… $pobj = get_queried_object(); echo $pobj->ID; … Read more

Syling Custom Fields echo’s from from functions.php

How about just echoing out the needed syntax like that: echo ‘<div class=”custom-field”>’ . genesis_get_custom_field(‘instrument’) . ‘</div>’; You can also just use CSS and style the header.entry-header { //your sexy styles goes here } Since other elements inside are wrapped in their own elements and styled separately (I mean the actual H1 and meta data) … Read more

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