The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Twenty Eleven Custom Header and Multi-Site wrong URI (1 post)

  1. meermedia
    Posted 4 years ago #

    I am using Twenty Eleven on a multi-site setup with domain mapping, and the problem I run into is that the header image referes to the network url instead of the mapped domain, potentially causing Google to label the sites as duplicate content. Apart from that, it also looks bad of course.

    I haven't found any other discussions on this topic, so I have devised a solution of my own using a child theme with a custom header.php.

    Look for the <img> tag of the header, and use this instead for the 'src':

    function strnposr($haystack, $needle, $occurrence, $pos = 0) {
        return ($occurrence<2)?strpos($haystack, $needle, $pos):strnposr($haystack,$needle,$occurrence-1,strpos($haystack, $needle, $pos) + 1);
     print(substr(get_header_image(),strnposr(get_header_image(),'/',4))); ?>

    It will transform the absolute url to a relative one.

    Does anyone have a better solution that doesn't require a child theme, or could the theme be updated?

Topic Closed

This topic has been closed to new replies.

About this Topic