Forums

CodeIgniter Integration - Override Page Title (5 posts)

  1. georgeedwards
    Member
    Posted 1 year ago #

    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.

  2. duck__boy
    Member
    Posted 1 year ago #

    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.

  3. georgeedwards
    Member
    Posted 1 year ago #

    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.

  4. georgeedwards
    Member
    Posted 1 year ago #

    Bump? Anyone have any ideas?

  5. duck__boy
    Member
    Posted 1 year ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic