Results 1 to 1 of 1

Thread: Need help in editing code for SEO reasons

  1. #1
    Thread Starter
    manishkhullar's Avatar
    Join Date
    Nov 2012
    Location
    India
    Posts
    893
    Thanks
    19
    Thanked 15 Times in 14 Posts

    Need help in editing code for SEO reasons

    Hi ... for SEO reasons I need to add customised alt tag as alt=category to the images in single listing.
    I saw the image gallery code is in images.php
    There is a function that returns large image with link.
    Here it is
    Code:
     function va_get_attachment_link( $att_id, $size = 'thumbnail' ) {
    	return html( 'a', array(
    		'href' => wp_get_attachment_url( $att_id ),
    		'rel' => 'colorbox',
    		'title' => trim( strip_tags( get_post_meta( $att_id, '_wp_attachment_image_alt', true ) ) )
    	), wp_get_attachment_image( $att_id, $size ) );
    }
    wp_get_attachment_image( $att_id, $size ) gives the image code.
    I would like to replace it with
    Code:
    $image_attributes = wp_get_attachment_image_src( $att_id );
    	if( $image_attributes ) {
    ?> 
    <img src="<?php echo $image_attributes[0]; ?>" width="<?php echo $image_attributes[1]; ?>" height="<?php echo $image_attributes[2];?>" alt="<?php echo $category;?>">
    <?php } ?>
    Basically I want to have img code returned or created where I can add alt tag with category. Pls help.
    A perfect place to outsource your SEO requirements. Check SEO prices in Australia.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Jomark HTML code displayed when editing resume
    By srd75 in forum Help Using JobRoller
    Replies: 4
    Last Post: April 3rd, 2014, 08:49 PM
  2. [SOLVED] This request has been denied for security reasons.
    By studio912 in forum Help Using Vantage (Legacy)
    Replies: 1
    Last Post: February 11th, 2014, 04:32 AM
  3. [SOLVED] what could be the reasons behind these 2 errors?
    By helmuc in forum Report ClassiPress Bugs
    Replies: 4
    Last Post: March 14th, 2013, 10:35 AM
  4. Changing Classipress Without Editing Source Code?
    By timkoch in forum ClassiPress General Discussion
    Replies: 1
    Last Post: February 25th, 2012, 07:49 AM