• Resolved francescag

    (@francescag)


    Hello,

    I need to add a tiny image to the Campaign Description, the text above main photo and the stats.

    I thought I could do this using an include post plugin so I could include a post where I can add the photo.

    But Insert Pages Plugin doesn’t work here, can you help me?

    • This topic was modified 8 years, 4 months ago by francescag.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @francescag,

    You could use the Featured Image field for the campaign, depending on whether your theme will show it.

    Alternatively, you could add an image using HTML. For examples of how to do that, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#Example_1_Alternative_text

    Cheers,
    Eric

    Thread Starter francescag

    (@francescag)

    Thank you @ericdaams for fast reply,

    I already use featured image, I need both of them. Basically the one I want to add is a thumbnail of the people that are ambassador of the campaign.

    I tried to add html code to the Campaign Description field and it works, it get my texts, but it doesn’t get the image, I see a no media class which I try to remove on summary.php file (lines 22>24) but didn’t work.

    This is an image different from campaign to campaign (sometimes I even do not need this), so I think I cannot add this thing on the template file. ??

    Can you help me?

    Thread Starter francescag

    (@francescag)

    I thought I could add an if post on description.php but it’s now working, maybe you could help me? I think this could be the way to achieve the result..

    The code I used is:

    <?php
        $post_id = get_the_ID();
        if ($post_id = "58") {
            echo "post 58";
        } else {
    echo "Not post 58";
    }
    ?>
    

    it always displays “post 58”

    Hi francescagr,
    the expression ($post_id = “58”) assigns to the variabile $post_id the string value “58” and the assignment is always sucessful so the logical condition is always “true“.

    That means that your code is exactly the same of:

    if (TRUE) {
            echo "post 58"; 
        } else {
            echo "Not post 58";
        }

    and that’s the reason why it always displays “post 58”.

    The following code should work:

    <?php
        $post_id = get_the_ID();
        if ($post_id == 58) {
            echo "post 58";
        } else {
            echo "Not post 58";
        }
    ?>

    Let us know.
    Byez.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Image in the Campaign Description’ is closed to new replies.