• Resolved romienas

    (@romienas)


    Hi,
    I’m trying to add different images in page title area. That I done, but I have problem with CSS. My CSS code simple not working ?? Where can be the problem?

    my code in content-page.php

    <header class="entry-header">
    		<h1 class="entry-title">
    			<?php the_title(); ?>
                    </h1>                    
    
                <div class="pus-iko">
                    <?php
                    if (is_page('apie-mus')) {
                        echo '<img src="/naujas/wp-content/uploads/2015/04/apie-mus.png" alt="Apie mus">';
                    }
                    if (is_page('paslaugos')) {
                       echo '<img src="/naujas/wp-content/uploads/2015/04/paslaugos.png">';
                    }
                    if (is_page('video')) {
                       echo '<img src="/naujas/wp-content/uploads/2015/04/video-galerija.png">';
                    }
                    if (is_page('projektai')) {
                       echo '<img src="/naujas/wp-content/uploads/2015/04/projektai.png">';
                    }
                    if (is_page('partneriai')) {
                       echo '<img src="/naujas/wp-content/uploads/2015/04/Partneriai.png">';
                    }
                    if (is_page('kontaktai')) {
                       echo '<img src="/naujas/wp-content/uploads/2015/04/kontaktai.png">';
                    }
                    ?>
                </div>      
    
    	</header>

    and my code in style.css:

    #pus-iko {
        float: right;
        border: 1px solid #000;
        background-attachment: red;
       }

    Link https://kitokiarenovacija.lt/naujas/apie-mus/

Viewing 6 replies - 1 through 6 (of 6 total)
  • What exactly is wrong? How do you want it to be?

    Thread Starter romienas

    (@romienas)

    Oh sorry forget to write that. The image shoud be in the right side. But at this point I can’t move him.

    Well I see your issue now.

    your selector is a class not id

    so it needs to be

    .pus-iko {
        float: right;
        border: 1px solid #000;
        background-attachment: red;
       }

    all you have to do is replace the # with a .

    Thread Starter romienas

    (@romienas)

    Thank you webdev2087 for your help, but after change # to . nothing happen. When I inspect element I can see only img class, how I understand my code not working..

    Thread Starter romienas

    (@romienas)

    Anyone know solution?

    Thread Starter romienas

    (@romienas)

    I found a solution. I delete code from style.css and in content-page.php file before <div class=”pus-iko”> I put code:

    <style>
    .pus-iko {
        float: right;
        border: 1px solid #000;
        background-attachment: red;
       }
    </style>

    And this solve my problem. Maybe it will help for others too ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Image into page title area’ is closed to new replies.