WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Query HELPP!! (2 posts)

  1. Zambrano Sergio
    Member
    Posted 2 years ago #

    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!

  2. Zambrano Sergio
    Member
    Posted 2 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic