WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Displaying alt dynamic alt tag on dynamic image (2 posts)

  1. robmuzo
    Member
    Posted 3 years ago #

    Hi guys, I'm trying to pull a dynamic meta generated alt tag onto a dynamic generated image using magic fields plugin.

    here is the code:

    <?php $logos = getGroupOrder('cl_logo_image');
    foreach($logos as $logo){ ?>
    
    <?php echo get('cl_logo_image_alt',$logo).""; ?>
    <?php echo get_image('cl_logo_image',$logo).""; ?>
    
     <?php } ?>

    Any ideas how I can display the first call to 'cl_logo_image_alt' inside the second call as an alt tag?

    thanks.

  2. robmuzo
    Member
    Posted 3 years ago #

    Fixed it used get in place of get_image:

    <?php $logos = getGroupOrder('cl_logo_image');
    foreach($logos as $logo){ ?>
    
    <img src="<?php echo get('cl_logo_image',$logo).""; ?>" width="90" height="90" alt="<?php echo get('cl_logo_image_alt',$logo).""; ?>" title="<?php echo get('cl_logo_image_alt',$logo).""; ?>" />
    
     <?php } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic