Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8607765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:26:28+00:00 2026-06-12T03:26:28+00:00

I am editing a template to try and add some conditional logic to my

  • 0

I am editing a template to try and add some conditional logic to my page.

The page template shows topics related to a user.

I want to add a piece of code which will grab the user name from the page we are viewing and then use that in a string for my conditional statements.

The code I have put together is as follows, but it breaks my page so I am doing something wrong.

<?php global
// I query the ID and try and set that to the $userID - I think I am doing this  wrong, but when I echo the ID it gets the correct info.
$userID = get_queried_object()->ID; 
// This is the string I create using the userID which should be from the query above
$memberstatus = get_user_meta($userID,'member_status',true); 

 ?>

later on I use IF statements to use thsi result (which i know work) so i won’t post them. My problem is trying to get the above to work.

Any help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:26:30+00:00Added an answer on June 12, 2026 at 3:26 am

    damm, looks like when I remove ‘global’ from the php it works! I thought global had to be in this…ah well

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the page template I've got: <h1>Editing user</h1> <% form_for(@user) do |f| %> <%=
page--node--edit.tpl.php works just fine when you want to create a specific template for editing
I'm using DataTemplateSelector with the WPFToolkit DataGrid. I want to select the editing template
I'm editing a ListViewItem template and I'm trying to add a custom control to
I'm new to template editing in wordpress and I'm trying to get a page
I am working on editing a template where I need to add a Lightbox
I have placed a textblock in a slider thumb by Template editing. I want
I should edit the dynamic_sidebar() function on wordpress (hiding some categories, editing the template).
I have a template for editing a franchise. Inside that template I have two
Editing this code here on Stackoverflow and I'm really near to get the result

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.