Getting the links from main wordpress website to wordpress blog manually

I have my wordpress site and a wordpress blog, the blog is subfolder of main website like http://www.wordpress.com/blog/

Now, i wanted to place the footer links of main website in blog footer, so that whenever i change the permalinks structure in main website then blog footer links also follow the same permalinks structure. I want to write a function like getpagelink and connect to main website database. i can get the page IDs of each post but how can i get the permalinks of that particular page.

Or is there any other way i can achieve this?

Solutions

If I understand your request, you can get the permalink of any post ID (including pages) with the following code:

<?php $permalink = get_permalink( $id ); ?>

See the Codex.

Tags: PHP / Mysql / Wordpress

Similar questions

One WordPress install for main site at domain.com and blog at blog.domain.com?
I asked this before over at the WordPress forums some time ago, before WP3 with MU was released and I think it's relevant that I ask it again, here instead, cause of WP3. Basically I want to have my personal website and blog both powered by WordPress, the website should be at www.domain.com (or domain.com) and the blog at blog.domain.com. My first ...
List all blogs apart from the current blog and main blog in WordPress Multisite
I need to list all current WordPress Multisite Blogs apart from the one the user is on and the main blog. We have a 404 page where we'd like to recommend other blogs (physical places) apart from the blog the user is current on and the main blog. Here is our structure: Main Blog (places) Blog 1 (New York) Blog 2 (London) Blog 3 (Paris) I can list al...
In which .php file does wordpress print out the blog titles, dates, authors on index.php (main blog listing)
I was curious because I needed to make some modifications to the code markup of each of my displayed blog posts in the index.php listing. I don't mean something like the_post(), I want to see the lowest level function where the raw html is being inputted. There is one line of html I need to append to all of my blogs so that the google authorship wo...
Blog Title not showing up on main Blog page
I cannot get the main blog page with the current blog to show the current blog title. It shows on all other pages, just not the current/most recent blog. Any help will be greatly appreciated. Thank you.
Change blog post title on main blog page
Looking to create a custom field to change the titles shown on the blog archive page without effecting them on the actual posts. (The purpose of this is to have shorter titles when viewing all the posts) I found the following line of code in blog-layout.php. edit: Also found the actual function: My first thought is that changing the get_the_ID() pa...
How may I put the last post summary of a blog inside of the main page of another blog?
I have two blogs. One personal and other professional. I do not want my clients to see my personal stuff inside my professional blog, but I want the last professional post two be viewed in my personal blog. If the reader clicks on the title, he is redirected to the professional blog. How do I do that? Is that even possible? Something like the kind ...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.