Create Unique ID for user

Here is some code that reads the highest number from the user meta table and then adds +1 to that number. This saves that number for each newly registered user. The code is triggered via the action hook “user_register”. add_action( ‘user_register’, ‘assignuserid’); function assignuserid($user_id) { global $wpdb; $latestid=$wpdb->get_var(“SELECT meta_value from $wpdb->usermeta where meta_key=’memnumber’ order by … Read more

How do I fix my static page

I’m assuming that you want to have a home page with it’s own content and then the blog to be elsewhere on your site. What you want to do is create a Page Template. Call it Home Page Template or something like that and you can make the file whatever you’d like – maybe template-homepage.php. … Read more

How to set up conditionals in page templates?

<?php /* Template Name:product */ get_header(); // check if product_id is not set or is empty string if( !isset($_GET[‘product_id’]) || ” == $_GET[‘product_id’] ) { // if so, run your query and display data $data = $wpdb->get_results(“myquery Here”); foreach($data as $row) { echo ‘<div>’; echo ‘<p>Name:’ . $row->p_name . ‘</p>’; echo ‘<p>Price:’ . $row->p_price. ‘</p>’; … Read more