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 one's a tough one - I have a JFrame that generates JTextFields. When
This question is related to this one , though I think I was a
Having a heckuva time with this one, though I feel I'm missing something obvious.
I have seen this question: Are there any decent UI components for touch screen
SO I'm working on a schedule app that uses a MySQL DB. One of
In a windows forms application, a property change that triggers INotifyPropertyChanged, will result in
UPDATE: It was suggested in the comments that I create a wiki for this.
I am using SQL Server Reporting Services 2008 (though this seems to be an
I'm running a regular expression against a large scalar. Though this match isn't capturing
When using Visual Studio (though ideally this can apply to the generic case) and

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.