Title: isitegate's Replies | WordPress.org

---

# isitegate

  [  ](https://wordpress.org/support/users/isitegate/)

 *   [Profile](https://wordpress.org/support/users/isitegate/)
 *   [Topics Started](https://wordpress.org/support/users/isitegate/topics/)
 *   [Replies Created](https://wordpress.org/support/users/isitegate/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/isitegate/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/isitegate/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/isitegate/engagements/)
 *   [Favorites](https://wordpress.org/support/users/isitegate/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 78 total)

1 [2](https://wordpress.org/support/users/isitegate/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/isitegate/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/isitegate/replies/page/4/?output_format=md)
[5](https://wordpress.org/support/users/isitegate/replies/page/5/?output_format=md)
[6](https://wordpress.org/support/users/isitegate/replies/page/6/?output_format=md)
[→](https://wordpress.org/support/users/isitegate/replies/page/2/?output_format=md)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Can’t create a new page in wordpress](https://wordpress.org/support/topic/cant-create-a-new-page-in-wordpress/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/cant-create-a-new-page-in-wordpress/#post-16567685)
 * Hi there,
 * In case someone faces this in future, here what worked in my case:
 * In fact, there were many rows with the same ID , i had to create new table , 
   copy the old table rows with auto increment option, remove the old table then
   rename the new table to the old table’s name. that did the trick.
 * Thanks all.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Can’t create a new page in wordpress](https://wordpress.org/support/topic/cant-create-a-new-page-in-wordpress/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/cant-create-a-new-page-in-wordpress/#post-16557695)
 * The code i used to remove the not optimised pages is here:
 *     ```wp-block-code
       <?php
       // Read ral-opt-slugs.txt file and store slugs in array
       $slugs = file('ral-opt-slugs.txt', FILE_IGNORE_NEW_LINES);
   
       // Connect to database
       $servername = "localhost";
       $username = "root";
       $password = "";
       $dbname = "test";
   
       $conn = mysqli_connect($servername, $username, $password, $dbname);
   
       // Check connection
       if (!$conn) {
           die("Connection failed: " . mysqli_connect_error());
       }
   
       // Ping the MySQL server to ensure the connection is still alive
       if (!mysqli_ping($conn)) {
           die("Connection lost.");
       }
   
       // Delete pages that are not in the list of slugs and not reserved
       $sql = "SELECT * FROM wp_posts WHERE post_type = 'page' AND post_name NOT IN ('" . implode("', '", $slugs) . "') AND post_name NOT LIKE 'media%' AND post_name NOT LIKE 'plugins%' AND post_name NOT LIKE 'themes%'";
       $result = mysqli_query($conn, $sql);
       if (mysqli_num_rows($result) > 0) {
           while ($row = mysqli_fetch_assoc($result)) {
               $id = $row['ID'];
               $sql = "DELETE FROM wp_postmeta WHERE post_id = '$id'";
               mysqli_query($conn, $sql);
               $sql = "DELETE FROM wp_posts WHERE ID = '$id'";
               mysqli_query($conn, $sql);
               echo "Deleted page with slug: " . $row['post_name'] . "\n";
           }
       } else {
           echo "No pages found for deletion.\n";
       }
   
       // Close database connection
       mysqli_close($conn);
       ?>
       ```
   
    -  This reply was modified 3 years, 3 months ago by [isitegate](https://wordpress.org/support/users/isitegate/).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Homepage returns 404 for non-logged users](https://wordpress.org/support/topic/homepage-returns-404-for-non-logged-users/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/homepage-returns-404-for-non-logged-users/#post-16287060)
 * Resolved
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Homepage returns 404 for non-logged users](https://wordpress.org/support/topic/homepage-returns-404-for-non-logged-users/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/homepage-returns-404-for-non-logged-users/#post-16287059)
 * Thank you for the reply.
 * sorry for wasting your time but it was my fault as previously I set the page 
   to private not public.
 * However, your reply gave me the hint as when I checked the reading settings i
   couldn’t find the homepage in the list of pages there so realised there is something
   wrong and remembered.
 * Sorted now.
 * Thanks again
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Send Users Email - Email Subscribers, Email Marketing Newsletter] How can I include Users’ IDs in their emails?](https://wordpress.org/support/topic/how-can-i-include-the-users-ids-intheir-emails/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/how-can-i-include-the-users-ids-intheir-emails/#post-16248698)
 * Worked fine,
    Thank you very much
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Send Users Email - Email Subscribers, Email Marketing Newsletter] How can I include Users’ IDs in their emails?](https://wordpress.org/support/topic/how-can-i-include-the-users-ids-intheir-emails/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/how-can-i-include-the-users-ids-intheir-emails/#post-16246796)
 * Hi Suman,
    That’s what I have done in the above code, can you please check it?
 * Regards
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[User Registration & Membership - Free & Paid Memberships, Subscriptions, Content Restriction, User Profile, Custom User Registration & Login Builder] How can i include User ID in confirmation email](https://wordpress.org/support/topic/how-can-i-include-user-id-in-confirmation-email-2/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/how-can-i-include-user-id-in-confirmation-email-2/#post-16246787)
 * Perfect.
    Thank you very much.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[User Registration & Membership - Free & Paid Memberships, Subscriptions, Content Restriction, User Profile, Custom User Registration & Login Builder] How can i include User ID in confirmation email](https://wordpress.org/support/topic/how-can-i-include-user-id-in-confirmation-email-2/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/how-can-i-include-user-id-in-confirmation-email-2/#post-16246192)
 * So the final code is :
 *     ```
       /* USER REGISTRATION PLUGIN => INCLUDE USER ID */
       add_filter('user_registration_add_smart_tags','ur_add_source_in_admin_email',10, 2 );
       function ur_add_source_in_admin_email($default_values,$email){
       $user = get_user_by( 'email', $email );
       $form_id = ur_get_form_id_by_userid( $user->ID );
       $form_post = get_post( $form_id );
       $post_title = $form_post->post_title;
       $current_user = wp_get_current_user();
       $custom_default_values = array(
       'ur_user_id' => $user->ID,
       'ur_user_first_name' => $current_user->user_firstname,
       'ur_user_last_name' => $current_user->user_lastname,
       );
       $default_values = array_merge($default_values,$custom_default_values);
       return $default_values;
       }
   
       add_filter('user_registration_smart_tags','ur_add_source_in_admin_emails',10, 1 );
       function ur_add_source_in_admin_emails($smart_tags){
       $custom_smart_tags = array(
       '{{ur_user_id}}','{{ur_user_first_name}}','{{ur_user_last_name}}'
       );
       $smart_tags = array_merge($smart_tags,$custom_smart_tags); return $smart_tags;
       }
       ```
   
 * but as I mentioned the first and last names are empty at the moment, how can 
   i get it to work, please?
 * Thank you
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[User Registration & Membership - Free & Paid Memberships, Subscriptions, Content Restriction, User Profile, Custom User Registration & Login Builder] How can i include User ID in confirmation email](https://wordpress.org/support/topic/how-can-i-include-user-id-in-confirmation-email-2/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/how-can-i-include-user-id-in-confirmation-email-2/#post-16246188)
 * Thanks a lot, Armit.
    Yes of course, well deserved.
 * Now I’m trying to add the user’s first and last name similarly, can you please
   advise what is wrong with my code? the first and last names are empty at the 
   moment:
 *     ```
        ..........................
       ..........................
       $current_user = wp_get_current_user();
       ```
   
 * $custom_default_values = array(
    ‘ur_user_id’ => $user->ID, ‘ur_user_first_name’
   => $current_user->user_firstname, ‘ur_user_last_name’ => $current_user->user_lastname,);………………………………………………………………
   $custom_smart_tags = array( ‘{{ur_user_id}}’,'{{ur_user_first_name}}’,'{{ur_user_last_name}}’);`
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Send Users Email - Email Subscribers, Email Marketing Newsletter] How can I include Users’ IDs in their emails?](https://wordpress.org/support/topic/how-can-i-include-the-users-ids-intheir-emails/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/how-can-i-include-the-users-ids-intheir-emails/#post-16245533)
 * Hi Suman,
    Thank you for the reply and I appreciate it very much.
 * Suman, for now, can’t you give me any snippet to add, please?
 * If you don’t mind, I’ll share my attempt with you and you can tell me what am
   I missing:
    (Please):
 * **1- I have added the placeholder for {{user_id}} in the “placeholder-instructions.
   php”:**
 *     ```
       <tr>
       				<td>
       					{{user_id}}<br>
       					<?php echo __( 'Use this placeholder to display user id', 'send-users-email' ); ?>
       				</td>
       			</tr>
       ```
   
 * _I now can see the new placeholder on the backend._
 * ** 2- I have amended 6 lines in the “class-send-users-email-admin.php”:**
    On
   lines: 240-243 & 373-376:
 *     ```
       $user_id = get_current_user_id();
       						// Replace placeholder with user content
       						$email_body = $this->replace_placeholder( $email_body, $username, $display_name, $first_name,
       							$last_name, $user_email, $user_id );
       ```
   
 * Then on lines: 556-570 the last function there as follwo:
 *     ```
       private function replace_placeholder(
       		$email_body,
       		$username,
       		$display_name,
       		$first_name,
       		$last_name,
       		$user_email,
       		$user_id
       	) {
       		$email_body = str_replace( '{{username}}', $username, $email_body );
       		$email_body = str_replace( '{{user_display_name}}', $display_name, $email_body );
       		$email_body = str_replace( '{{user_first_name}}', $first_name, $email_body );
       		$email_body = str_replace( '{{user_last_name}}', $last_name, $email_body );
       		$email_body = str_replace( '{{user_email}}', $user_email, $email_body );
       		$email_body = str_replace( '{{user_id}}', $user_id, $email_body );
   
       		return nl2br( $email_body );
       	}
       ```
   
 * I hope you will give it a few minutes and paste you feedback here so i can get
   it done.
 * Thank you in advance.
 * Regards.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[User Registration & Membership - Free & Paid Memberships, Subscriptions, Content Restriction, User Profile, Custom User Registration & Login Builder] How can i include User ID in confirmation email](https://wordpress.org/support/topic/how-can-i-include-user-id-in-confirmation-email-2/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/how-can-i-include-user-id-in-confirmation-email-2/#post-16242160)
 * That worked.
    Thank you very much for your help.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Delete all pages (thousands) except a few by their IDs](https://wordpress.org/support/topic/delete-all-pages-thousands-except-a-few-by-their-ids/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/delete-all-pages-thousands-except-a-few-by-their-ids/#post-14564546)
 * Thank you
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Job Board] Templating is not working for me](https://wordpress.org/support/topic/templating-is-not-working-for-me/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/templating-is-not-working-for-me/#post-14156008)
 * Thank you for the reply, it works now.
    I wonder why something essential like
   that is not mentioned in the documentation.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Job Board] I want to make jobs my homepage](https://wordpress.org/support/topic/i-want-to-make-jobs-my-homepage/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/i-want-to-make-jobs-my-homepage/#post-14074476)
 * Hi [@jerrykza](https://wordpress.org/support/users/jerrykza/), thank you for 
   the reply.
    Dashboard Settings > Readings > Your Homepage Display > there is 
   no page called jobs over there. any idea why, please? jobs page seems custom,
   not like other pages, there is no edit page option for example
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Job Board] I want to make jobs my homepage](https://wordpress.org/support/topic/i-want-to-make-jobs-my-homepage/)
 *  Thread Starter [isitegate](https://wordpress.org/support/users/isitegate/)
 * (@isitegate)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/i-want-to-make-jobs-my-homepage/#post-14074047)
 * But still i wonder, why can’t you set homepage in
    jobboard => settings [https://prnt.sc/100v0ze](https://prnt.sc/100v0ze)

Viewing 15 replies - 1 through 15 (of 78 total)

1 [2](https://wordpress.org/support/users/isitegate/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/isitegate/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/isitegate/replies/page/4/?output_format=md)
[5](https://wordpress.org/support/users/isitegate/replies/page/5/?output_format=md)
[6](https://wordpress.org/support/users/isitegate/replies/page/6/?output_format=md)
[→](https://wordpress.org/support/users/isitegate/replies/page/2/?output_format=md)