Domanda

Sto scrivendo una funzione per rendere tutte le mie immagini di intestazione che si collegano alle rispettive home page. Ho scritto questa funzione:

    function get_category_location(){
    $header = get_category_header();
    $home = bloginfo('url');

    if ($header == 'wth') {
        $location = $home . "/wth/" ;
    }

    else if ($header == 'campus' || $header == 'tech') {
        $location = get_category_link();
    }

    else {$location = $home;}

    return $location;

}

Quindi, quando fai clic su un'intestazione nella sezione WTH del nostro sito $ intestazione dovrebbe essere uguale a "wth" e $ home dovrebbe essere uguale a "http://dev.reesenews.org" e quindi la posizione dovrebbe essere impostata su "http: // dev. Reesenews.org/wth/ '

Per quanto posso dire a $ intestazione e $ home sono corretti.

Nessuna soluzione corretta

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a wordpress.stackexchange
scroll top