• Hi.

    Say I have two different blogs, both in WordPress. I want both to have the same header template and, to make it easy, when I change something in one of them, I want to appear changed in the other blog.

    So, my idea is to have a header.php in one of the blogs, and in the other one call it so that it uses the SAME one. I’ve tried with Include (path to the header of the other blog), but it doesn’t work.

    Can someone help me please?

    Cheers

Viewing 6 replies - 1 through 6 (of 6 total)
  • This sounds like a pretty strange idea. How often do you actually plan to change the header template once the design is completed? If you add a page to one site, do you want it to appear on the other one?

    Thread Starter salva87

    (@salva87)

    Hi Chrisber.

    I said header, but I’m actually planning to do it also with the footer and sidebar and it’s not with 2 blogs, but 6, so if I want to change something in one of them, I have to do it in every one… It’s difficult to explain jeje.

    I don’t want the posts to appear in all the blogs, just the sidebar, footer and header templates. How can that be done?

    Cheers

    From what you’re saying, all you want is to have to change Blog A’s header and Blogs B-F’s headers change too. If this is correct, try this.

    <?PHP include("https://bloga.com/header.php");?>

    Where “https://bloga.com/header.php&#8221; leads to your header in Blog A. Place that code in your Main Index Template so that it replaces:

    <?php get_header(); ?>

    See how that works..

    Thread Starter salva87

    (@salva87)

    Doesn’t work. When I refresh:

    Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/foroatle/public_html/wp-content/themes/Wordpress_Magazine/index.php on line 1
    
    Warning: include(https://www.foroatletismo.com/entrenamiento/wp-content/themes/acosminv2/header.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/foroatle/public_html/wp-content/themes/Wordpress_Magazine/index.php on line 1
    
    Warning: include() [function.include]: Failed opening 'https://www.foroatletismo.com/entrenamiento/wp-content/themes/acosminv2/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/foroatle/public_html/wp-content/themes/Wordpress_Magazine/index.php on line 1

    This sounds like a complicated solution to a simple problem. Why not just install one version of WP locally and do all of your theme updates on the local version. As long as all of your sites are hosted on the same account, it should not take more than one minute to update all 6 by FTP when necessary.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    When you do an include, you don’t include the http path to the file, you include the real server path to the file.

    So this include('https://whatever'); won’t work. You need to actually give it the real path. Like /var/www/yourname/whatever/wp-content/themes/themename/header.php.

    Alternatively, you could make the entire theme directory on one site a symlink to the other.

    Both solutions absolutely require that the blogs are on the same server. If they’re not, then you can’t do it at all, period.

    Although I agree with Chrisber, sounds like a heck of a lot of work for little gain.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Get something from another URL’ is closed to new replies.