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 876595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:27:30+00:00 2026-05-15T11:27:30+00:00

This is a tough one, and will require some up to date expertise on

  • 0

This is a tough one, and will require some up to date expertise on WordPress to figure this one out.

I have an external script that hooks into the database backend and I can work with everything pretty successfully, but one thing I cannot do is get permalinks using get_permalink($post_id) for any blog other than the main blog.

For example, if I switch my table prefix from wp_1_ to wp_2_ so that my focus is on workin with blog id 2, get_permalink() when called will still try to get the permalink for blog 1, because I am including /wp-config.php.

What/how can I change a CONSTANT so that get_permalink() will pull from a newly designated blog id?

I really appreciate any guidance,

Hudson

  • 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-05-15T11:27:32+00:00Added an answer on May 15, 2026 at 11:27 am

    Use switch_to_blog($blog_ID) – codex.wordpress.org/WPMU_Functions/switch_to_blog.

    WordPress is then aware of which blog you’re working with, and all functions should work as expected.

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

Sidebar

Related Questions

This is a tough one to google for. I have an XML document that's
I have an interesting problem to solve here that may require some creative direction.
I am having the hardest time figuring this out, even though it is one
I have tough time making this design decision. I could go with traditional new
Bit of a random one, i am wanting to have a play with some
I'm having some trouble figuring out how to require a class has extended an
I have the following XML example that I need some help on. The sample
I have some Visual C++ code that receives a pointer to a buffer with
Some facts about my data I have a TablePattern that defines periodic day pattern
This is a question that I have been pondering for a long time ,

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.