Title: Multisite Blog_ID
Last modified: August 20, 2016

---

# Multisite Blog_ID

 *  Resolved [Jerry Craig](https://wordpress.org/support/users/cupbearer/)
 * (@cupbearer)
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/)
 * I’ve got a couple questions.
 * 1) I’ve got a multisite install and am using custom product post_types in subdirectory
   blogs. As each Product is posted I would like to create a Product ID number that
   is unique that includes the “Blog Id number – post id” which should then be unique
   across the multisite install.
 * 2) I would like to also use the same categories and tags across the entire multisite
   install. I’m using CMS Press to create my custom post_type. Do I just reset the
   blog to original before the CMS Press hook somehow or maybe a custom query and
   custom plugin? I’m going to use a sphinx search server and I’m hoping for a large
   number of individual product listings. The size should be small though of each
   record. The Categories are going to match Google’s Product Taxonomy and the tags
   are going to be used for my Meta Keywords so I will actually need both although
   that’s probably not considered best practices.
 * Thanks,
 * Cupbearer

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/multisite-blog_id/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/multisite-blog_id/page/2/?output_format=md)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079176)
 * 1) So you want to know how to extract the blogID?
 * It’s under blog_ID
 *     ```
       global $blog_id;
       echo $blog_id;
       ```
   
 * should do it.
 * 2) No idea, but someone else may know of a plugin for it.
 *  Thread Starter [Jerry Craig](https://wordpress.org/support/users/cupbearer/)
 * (@cupbearer)
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079194)
 * umm… wow, i read around all that stuff yesterday for something else, can’t believe
   I didn’t see that. So #1 is done. It ended up looking like this:
 *     ```
       <?php global $blog_id;
              $meta_values = get_post_meta($post->ID, 'msrp', true);
              echo "Product#: " . $blog_id . "-" . $post->ID . "    MSRP: $ " . $meta_values;
       ?>
       ```
   
 * to see it would be at [foodnav.com/lilsassysalsa](http://foodnav.org/lilsassysalsa)
   page 🙂
 * Now just for the global Categories and Tags. There are 83 Categories before I
   start adding my own more specific ones and I have just barely started adding 
   tags but expect to have way way more than that. I would really like to just click
   select each of them in the sidebar of my custom post_type entry page.
 * Thanks for the help so far.
 * [Removed sig – They’re against forum rules]
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079197)
 * [http://wordpress.org/extend/plugins/wpmu-new-blog-defaults/](http://wordpress.org/extend/plugins/wpmu-new-blog-defaults/)
   can be used to set up the categories for all new sites.
 * As for the rest, the best I can think of is Sitewide tags, which gathers up all
   the new posts across the network and puts them on the main blog. see instructions:
   
   [http://wpmututorials.com/plugins/using-the-sitewide-tags-plugin/](http://wpmututorials.com/plugins/using-the-sitewide-tags-plugin/)
 *  Thread Starter [Jerry Craig](https://wordpress.org/support/users/cupbearer/)
 * (@cupbearer)
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079203)
 * I took number 2 issue to VOCE Communications since they are the ones that did
   the [CMS Press](http://vocecommunications.com/services/web-development/wordpress/plugins/cms-press/)
   plugin that I’m using and whatever I do with the widgets in the sidebar is going
   to be a part of their plugin and code.
 * However, if I can’t get something from them to help out, I’ll be back to build
   a custom widget to try to stick into their plugin in the dropdown screen options
   section. Just an FYI.
 * [Sig Deleted]
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079204)
 * Yeah, the problem with it is that MultiSite is a network of related but disconnected
   sites. Think WordPress.com or Blogger 🙂 Your site has no ‘data’ in common with
   the others on the network.
 * Also please don’t use signatures on the forums, they’re not allowed.
 *  [Andrea Rennick](https://wordpress.org/support/users/andrea_r/)
 * (@andrea_r)
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079206)
 * If you’re creating custom posts types and need them across the network – don’t
   use a plguin. hand code them and put the code in mu-plugins.
 * that won’t set up global categories though.
 *  Thread Starter [Jerry Craig](https://wordpress.org/support/users/cupbearer/)
 * (@cupbearer)
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079212)
 * sorry, fixed my gravatar also 🙂 Had the wrong email addy in profile.
 * That indeed is the issue for me. The site is going to be a Free Directory of 
   smaller food companies. I want to explicitly control the data so that it’s uniform
   and easily searchable, but leave all of the aspects of design and layout open
   to the individual companies to make it match their own sites if they want to 
   take the time to do so and maybe change some aspects of the data, like descriptions
   and such. I’m sure it’s coming in a future release of WordPress as it is becoming
   more and more a CMS and less blogger only tool, but that’s not now. When I started
   working on this in my spare time at version 2.8 mu everything is completely different
   now.
 * Thanks
 *  Thread Starter [Jerry Craig](https://wordpress.org/support/users/cupbearer/)
 * (@cupbearer)
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079215)
 * I had thought to put it all in the child theme “functions” file for the custom
   post_types, but since I plan on letting others into the theme to possibly change
   some of the css display stuff and things like that I thought it better to keep
   them outside in the plugins portion, just in case so others couldn’t mess it 
   up. Are you saying then that I could write the plugin myself and load it up into
   the mu-plugins folder and have that across all of the blogs with all of the specifics.
   The CMS Press is pretty quick as all of the fields are saved by the browser and
   it’s just a quick dropdown to pick the custom field that I’m lookin for and then
   enter the data.
 * I have some reading and studying into the plugin and widget aspects as I’m still
   quite the noob. I’m about 3/4 of the way through the lynda.com plugins and widgets
   tutorial so I recognize what’s going on if not specifically how to change it.
 * Thanks,
 *  Thread Starter [Jerry Craig](https://wordpress.org/support/users/cupbearer/)
 * (@cupbearer)
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079218)
 * so, if I have more questions on what I was working on yesterday should I just
   add them to this discussion or start a new one?
 * thanks,
 *  Thread Starter [Jerry Craig](https://wordpress.org/support/users/cupbearer/)
 * (@cupbearer)
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079223)
 * ok, so i was working on this yesterday.
 * `<title><?php echo bloginfo('name')." | " . get_post_meta(102, 'zip', true) ."
   | Foodnav.org" ;?></title>`
 * It gives me the result I wanted on the blog that I was on. I’m going to put the
   custom field on the “About” page, but that page will be located in different 
   post_id’s and I’ve put this in the header.php file. I’m guessing that I need 
   to declare a variable and then get post_id from the permalink somehow since that
   will always be the same? So how do I return the post->ID for a specified permalink.
   Some sort of bloginfo url and add the “about” at the end and then try to get 
   the ID from that?
 * Thanks,
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079229)
 * What are you trying to accomplish with that code?
 *  Thread Starter [Jerry Craig](https://wordpress.org/support/users/cupbearer/)
 * (@cupbearer)
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079239)
 * The <title> tag in the header I want to have the individual companies name that
   contains just their Products then a zip code and then the name of my site. So
   it looks like this on the test product’s that I’ve entered:
 * Lil’ Sassy Salsa | 85246 | Foodnav.org
 * I want the zip code so that I can start to localize the searches in the future
   to locally made products only if that is what someone is looking for. Zip codes
   seems the easiest standard data size/format to use. In the single post title 
   tag I want to add the name of the Product which is the Title of my custom post_type
   so that it would look like this:
 * Lil’ Sassy Salsa | Chipotle Salsa | 85246 | Foodnav.org
 * It’s just a way to standardize the data. I figured out that since I want to store
   the custom field in the “About” section for each company as a standard place 
   to store it, that I could then pull that data back into any of the pages I wanted
   in the Title tag.
 * Thanks,
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079253)
 * And you’re using the same theme for every site, and not every site has the same
   post-id for the about page?
 * Uuuuugh. I have to think about this…
 *  Thread Starter [Jerry Craig](https://wordpress.org/support/users/cupbearer/)
 * (@cupbearer)
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079255)
 * That will be the fall back to make the “about” page the very first page in every
   new install, but, eventually that will cause a problem.
 * The themes may actually change and use my theme as the parent theme so that they
   can change up the colors and stuff to match their actual web sites so that the
   directory listing matches up to their existing color schemes and logo’s and stuff.
 * thanks,
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years ago](https://wordpress.org/support/topic/multisite-blog_id/#post-2079257)
 * If layout stays the same and only colors change, you can use the Safe CSS plugin
   to let each site change at will.
 * it’s the extraction of the zip that has me caught. Is this a per-post zipcode,
   or a per-site?

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/multisite-blog_id/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/multisite-blog_id/page/2/?output_format=md)

The topic ‘Multisite Blog_ID’ is closed to new replies.

## Tags

 * [multisite](https://wordpress.org/support/topic-tag/multisite/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 22 replies
 * 3 participants
 * Last reply from: [Jerry Craig](https://wordpress.org/support/users/cupbearer/)
 * Last activity: [14 years, 12 months ago](https://wordpress.org/support/topic/multisite-blog_id/page/2/#post-2079432)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
