Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi there,

    The top part of this reply is mainly about arrays so hopefully if you ever find yourself in a similar situation in the future you can hopefully avoid soiling your office chair – teach a man to fish and all that.
    If you want to just get the code skip to the bottom.

    You can think of an array as a collection of information (AKA values). You can get a specific value from an array by using a key.

    $array = array(
        "foo" => "bar",
        "bar" => "foo",
    );
    
    echo $array['foo']; //will echo bar

    In php the key is optional, when it is not used PHP will use the increment of the largest previously used integer key.

    $array = array("foo", "bar", "hello", "world");
    var_dump($array);

    Outputs:

    array(4) {
      [0]=>
      string(3) "foo"
      [1]=>
      string(3) "bar"
      [2]=>
      string(5) "hello"
      [3]=>
      string(5) "world"
    }

    The documentation for wp_get_attachment_image_src in the codex tells us that it returns an array containing:

    • [0] => url
    • [1] => width
    • [2] => height

    So the solution to your problem should be:

    <?php foreach( $images as $image ) : ?>
    $full_image = wp_get_attachment_image_src(,$image->ID,'full');
    $medium_image = wp_get_attachment_image_src(,$image->ID,'medium');
    <a class="zoom" rel="thumbnails" href="<?php echo $full_image[0]; ?>"><img src="<?php echo $medium_image[0]; ?>"></a>
    <?php endforeach; ?>
    Plugin Author sherred

    (@sherred)

    Civic’s cookie control software only tries to include jquery from the google api if it does not find it already loaded by the theme.
    Pages in a twenty twelve theme with no other plugins show the cookie control plugin.

    This makes me think that it is more likely to be a plugin or theme conflict.

    Plugin Author sherred

    (@sherred)

    I plan to fix this in the next version.
    I was wanting to release it earlier but haven’t had the time

    Plugin Author sherred

    (@sherred)

    The link is not to my site. I have nothing to do with civic uk.
    I have just wrapped their code into a WordPress plugin.

    They’ve created a free tool for people, I think it’s fair they get some credit for it.

    Plugin Author sherred

    (@sherred)

    Hi version 1.4 has just been released. This uses the new look

    Plugin Author sherred

    (@sherred)

    Hi,

    the current version of the plugin uses the previous version of Civic’s Cookie Control.

    the new version was only released a couple of weeks ago and will be used in the next version of the plugin, which I should have ready in the next few days.

Viewing 6 replies - 1 through 6 (of 6 total)