Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6541705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:08:15+00:00 2026-05-25T11:08:15+00:00

I have written a Zend application and have included WordPress for blogging. When I

  • 0

I have written a Zend application and have included WordPress for blogging. When I first installed WordPress I themed it so that it used the same header etc as the main application. I have since redone the main theme twice and had to redo the WordPress theme to match. Is there a way for WordPress to use my Zend layout? My first thoughts are to break up my layout into header/footer files and include them from WordPress using the full paths. Although it would work, it is far from ideal (I would prefer to keep the layout file in one piece).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:08:15+00:00Added an answer on May 25, 2026 at 11:08 am

    For many websites you may need to install WordPress for blogging integration. When it comes to skinning the blog you are pretty much limited to copying the html from your Zend_Layout into the WordPress header.php and footer.php files. This is duplication, and if you make any changes to your layout, you will need to update the blog theme as well. Well, there is another way!

    Alter Your Zend Application

    Make a separate bootstrap file for your Zend application (for example by following this guide: Access Zend Application Resouces from Other Applications).

    <?php
    // Define path to application directory
    defined('APPLICATION_PATH')
        || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
    
    // Define application environment
    defined('APPLICATION_ENV')
        || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
    
    // Ensure library/ is on include_path
    set_include_path(implode(PATH_SEPARATOR, array(
            realpath(APPLICATION_PATH . '/../library'),
            get_include_path(),
        )));
    
    /** Zend_Application */
    require_once 'Zend/Application.php';
    
    // Create application, bootstrap, and run
    $application = new Zend_Application(
            APPLICATION_ENV,
            APPLICATION_PATH . '/configs/application.ini'
    );
    $application->bootstrap();
    

    In your index.php file, to run your application:

    include('bootstrap.php'); //where bootstrap.php is the file of the new bootstrap file
    $application->run();
    

    WordPress Magic

    Now comes the WordPress magic.

    Get Zend Layout

    In your new WordPress theme folder, create a file named ‘Zend_Layout.php’ and copy/paste this code into it:

    <?php
    //load Zend_Layout
    $layout = new Zend_Layout();
    
    //add the blog's stylesheet to the header
    $view = $layout->getView();
    $view->headLink()->appendStylesheet(get_bloginfo( 'stylesheet_url' ));
    
    // Set a layout script path:
    $layout->setLayoutPath(APPLICATION_PATH . "/modules/default/views/scripts");
    $layout = $layout->render();
    

    Header

    Change the header.php file to:

    <?php
    include('zend_layout.php');
    echo substr($layout, 0, strpos($layout, '<div id="container">'));
    ?>
        <div id="container">
    

    This will load the $layout variable from the previous script and echo everything up to your main container div.
    Footer

    The footer.php is similar:

        </div><!-- #main -->
    <?php
    
    include('zend_layout.php');
    echo substr($layout, strpos($layout, '<div id="footer">'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP application that is written with Zend Framework. It uses Phing
I have an application written on top of the Zend Framework that is hosted
I have a CMS application written using the Zend Framework that allows you to
All, I have a PHP5 application written with Zend Framework and MVC style. My
Alright here's the situation, I have an application written in the Zend_Framework, that is
I have application written in Zend Framework and structure is app/ application/ library/ public/
I have inherited an application written with Zend Framework 1.11.2. It has been ported
I have project written in Zend Framework and it works fine most of environments.
I have written a toolbar that runs on the taskbar. Unfortunately, after it is
I have written a class in python that implements __str__(self) but when I use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.