Title: WordPress Query HELPP!!
Last modified: August 20, 2016

---

# WordPress Query HELPP!!

 *  [Zambrano Sergio](https://wordpress.org/support/users/sergiozambrano/)
 * (@sergiozambrano)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/wordpress-query-helpp/)
 * I never understood MYSQL further than copy-paste from existing basic cripts… 
   and I don’t understand WP queries!!
 * There are SO many functions that do the same out there, and I’ve tried them all,
   no success 🙁 and now I realize nothing works because the queries weren’t designed
   for that 🙁 and the solution is probably to build a custom one, and although 
   they seem a 8-line script, I don’t understand them!
 * Would you write a few lines (I saw them being a few lines only!) for a custom
   query that “switches” blog?, something like:
    “**Select the only page from blog1
   that matches this page_name**” (or title)
 * I’d use it then inside the loop, since It’s mostly content, but I’d probably 
   recycle it to get masthead content from a unique page (in the other blog) which
   resides in a page so it can be edited.
 * In other words, that would solve me the whole “alias” or “mirror” pages I was
   looking for.
 * Help!

Viewing 1 replies (of 1 total)

 *  Thread Starter [Zambrano Sergio](https://wordpress.org/support/users/sergiozambrano/)
 * (@sergiozambrano)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/wordpress-query-helpp/#post-2309869)
 * Ok, I found this.
 * $mainsite_pageid = $wpdb->get_var(“SELECT ID FROM $wpdb->post WHERE post_name
   = ‘current-page-slug’ “);
 * and then using something like get_blog_post()
 * Anytime you give me feedback about this, you are saving me days of re-coding 
   searching for a better way 🙂
 * Thoughts?

Viewing 1 replies (of 1 total)

The topic ‘WordPress Query HELPP!!’ is closed to new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [query](https://wordpress.org/support/topic-tag/query/)
 * [select](https://wordpress.org/support/topic-tag/select/)

 * 1 reply
 * 1 participant
 * Last reply from: [Zambrano Sergio](https://wordpress.org/support/users/sergiozambrano/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/wordpress-query-helpp/#post-2309869)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
