• Hey guys

    Forgive me if this is a basic question but…

    I have successfully gotten CI & WP to integrate with each other. I installed CI in a sub domain of the main WP site and I can call WP from the CI system.

    My question is, if I call get_header() and get_footer() etc to retrieve bits of the template, how can I set my page title from CI when it is already configured in the header.php file?

    Is there a way to override?

    Any help would be gratefully received. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The title in the source file ‘header.php’ is probably called using the function bloginfo('sitetitle'), or something similar – you can replace that with code to get the site title from some other source.

    Thread Starter georgeedwards

    (@georgeedwards)

    Hey thanks for your time.

    It’s actually using wp_title(); but I see what you mean. I thought about creating a new header such as header-codeigniter.php and then calling that using get_header('codeigniter'); … but still I can’t see this leaving me much flexibility.

    I would have hoped I could use something similar to get_header('codeigniter', $data); where $data is an array/object of data that can be passed through to the template.

    Is there any way to do this without hacking the WP core? Or could you suggest a better way?

    Thank you for your time once again.

    Thread Starter georgeedwards

    (@georgeedwards)

    Bump? Anyone have any ideas?

    I’ve experienced similar issues in the past in relation to sidebars, but been able to work around them by creating different bars.

    How about a small function to add an options page to the back end, so that you can save the data you wnat to options. You could then add a little code to the header to test the values and produce the header accordingly?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CodeIgniter Integration – Override Page Title’ is closed to new replies.