Support » Plugin: Custom Content Type Manager » [Plugin: Custom Content Type Manager] responsive images :raw

  • i´m having some troubles regarding the to_image_array_OutputFilter using the third example with raw image…

    it scales to 100% but crops the image in the height… i want it to be responsive…

    <?php $image_id = get_custom_field('Bild1');
    list($src, $w, $h) = wp_get_attachment_image_src($image_id);?>
    <img src="<?php print $src; ?>" width="100%" height="auto" />

    it somehow seems that it takes the wrong picture id too…

    i´m using Version

Viewing 2 replies - 1 through 2 (of 2 total)
  • get_custom_field(‘Bild1’ ‘full’); didn´t work… so i put full instead of thumbnail in wp-includes/media.php – if there´s another way please let me know…

    Plugin Contributor fireproofsocks


    I’m not sure if handled that correctly — the current version is, so I’d recommend that you update specifically because 0.9.4 brought a lot of improvements to the Output Filter functionality. There’s a page in the wiki: including a video. The sample templates in 0.9.4.x are also improved, giving you fuller examples of how to use the output filters.

    If you’re using the “to_image_array” filter, then it should be returning an array of image attributes, so if that’s what your field is using, then the get_custom_field() function would return an array, not the image id… like this:

    <?php list($src, $w, $h) = get_custom_field('Bild1');?>

    In 0.9.4, you can double-check this or override it by specifying the “raw” filter, and that would give you your image id:

    <?php $image_id = get_custom_field('Bild1:raw');?>

    But that’s only available in 0.9.4. You can check the image id with your uploaded media items… find the image you linked to, and if you edit it, your URL should display the image id, e.g. “123” in the example below:

    Also… Your images should be scaled in terms of pixels, not in percentages. A lot of layouts clip the content area so if your image is too large, it gets clipped. This could be what you’re experiencing.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Custom Content Type Manager] responsive images :raw’ is closed to new replies.