jeudi 1 août 2019

Wordpress functions.php Conditional Tag for Portfolio Pages

I am using Wordpress and Avada theme to build a website. I needed to change logo in some pages so I used some css code in those pages to remove the logo (because avada does not provide this option) and then I inserted the following line of code in order to insert the new one and everything works fine (here is just for a single page with ID=11).

    add_action( 'avada_logo_prepend', 'logo_image_home' );
    function logo_image_home() {
    if( is_page( '11' )  )  {
    echo '<a href=" here I put my href "><img class="lazyload" src="  here I put the link of my logo " data-orig-src=" same here " /></a>';
    }
    }

the problem is when I try to do the same thing with some portfolio pages (Portfolio posts). I tried to use if ( is_post_type_archive( '146' ) ) or if ( is_archive( '146' ) ) instead of if ( is_page( '146' ) ) but nothing seems work. I am not a developer so this looks quite complicated to me to solve.

Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire