Fancy Images, default alt value. Awake, wordpress

resolved (9 posts) (2 voices)

  1. Victorross
    Member

    Hi, how are you people?
    I want to know how can i define the [fancy_image] alt value so i do not have to write it every time i publish a post. (All my post have images and i use this shortcode)
    I need that the Alt=' ' for all my images get the "Post Title, Post Date"
    So please, let me know if i can get this with a code, i think i have to edit the shortcode.php, i find this lines:

    function webtreats_fancy_images_sc( $atts, $content = null ) {
    	global $post, $wpdb;
    	$post_title = get_the_title($post->ID);
    
    	extract(shortcode_atts(array(
    		'link' => '',
    		'target' => '',
    		'title' => '',
    		'alt' => '',
    		'height' => '200',
    		'width' => '188',
    	), $atts));

    So, is this the code that do i have to edit? Can anyone help me with the function to show 'post title, post date' there.

    Thanks you a lot!
    See you.

    Posted 1 year ago #
  2. Ruderic
    Support

    Hello,

    In that file, look for line #560. Replace the code there with this new code:

    $out .= '<span class="rm_img noscript"><img class="framed portfolio_hover" height="' .$height. '" width="' .$width. '" alt="' .mysql2date( 'd-m-Y',$post->post_date ) . ', ' .$post_title. '" title="' .$title. '" src="' .$image_url. '" /></span>';

    Try that and let us know the results.

    Posted 1 year ago #
  3. Victorross
    Member

    Thanks Ruderic!
    Great support, that was what i need.
    See you!

    Posted 1 year ago #
  4. Victorross
    Member

    One more question, wich is more important for SEO the ALT value or the TITLE value? Should i put the title and alt the same value (post_title and post_date)
    Thanks for the advice!
    See you!

    Posted 1 year ago #
  5. Victorross
    Member

    Now, i have another question, how can i insert the Alt or Title value for the [galleria] shortcode?
    Hope you can help me. I want to get the same solution that you gave me before or the fancy_images.
    Regards!

    Posted 1 year ago #
  6. Ruderic
    Support

    Hello,

    Regarding SEO, what really matters is your content, not your tags attributes. Write regular good content, get good incoming links, and you will appear on top of the search results.

    For image, the ALT tag is more important. When it comes to links, then the TITLE is the important tag.

    Regarding galleria, go to line #486 of the shortcodes.php file. You will find this code:

    $out .= '<a href="' .$gallery_img. '"><img alt="" class="noscript" src="' .webtreats_image_resize($img_height=40, $img_width=60, $img). '" /></a>';

    Replace it with:

    $out .= '<a href="' .$gallery_img. '"><img alt="' .mysql2date( 'd-m-Y',$post->post_date ) . ', ' .$post_title. '" class="noscript" src="' .webtreats_image_resize($img_height=40, $img_width=60, $img). '" /></a>';

    Posted 1 year ago #
  7. Victorross
    Member

    Thanks! My question about the SEO is because till now i have a good search images results, but i have been writing the fancy_images like this:
    [fancy_images title="....name for the post, date for the post"] ....ursl [/fancy_images]
    And now with your help i do not write this title value any more, it just get from the shortcode.php function by the alt value you give me.
    But will i get the same results? I mean, when it get the alt="" value from the shortcode.php is the same that when i wrote it one by one for each post fancy_images?
    Maybe i will try copy/paste the alt=""' .mysql2date( 'd-....etc" to the title="" value in the shortcode.php, Will that help me for the SEO or wont?
    Thanks for your help!
    Thanks!

    Posted 1 year ago #
  8. Ruderic
    Support

    Hello,

    The PHP code produces HTML, so it's exactly the same if you generate your "alt" attributes from the Wordpress admin panel or from the PHP code.

    Posted 12 months ago #
  9. Victorross
    Member

    Thanks!

    Posted 12 months ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme