Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter whiterider12

    (@whiterider12)

    Thanks, but I figured it out. Here is the code:

    $image_tag = wp_get_object_terms($post->ID, 'product_tag');
    	if(!empty($image_tag)){
    		if(!is_wp_error( $image_tag )){
    			foreach($image_tag as $term){
    			$image_tag_class .= $term->name.' ';
    			}
    		}
    		$image_tag_class = strtolower($image_tag_class);
    	}

    HTML:
    <img class="<?php echo $image_tag_class; ?>">

    Thread Starter whiterider12

    (@whiterider12)

    Ok, I got it in few hours. Here is what I am using as a script on my post templates to show the alias links, I am using alias permalinks for pretty share links since the website is in bulgarian, if there is no custom permalink, than the post is in english:

    <?php
      $custom_fields = get_post_custom();
      $perma_alias = $custom_fields['_custom_permalink_alias'];
    if ($perma_alias) { foreach ( $perma_alias as $key => $value );
    $perma_a_link = home_url( '/' ).$value;
    $lang_a ="bg"; }
    else { $perma_a_link = get_permalink();
    $lang_a ="en"; }
    
    if ($value) { $perma_a_link = home_url( '/' ).$value; } else { $perma_a_link = get_permalink(); }
    ?>
    
    <a hreflang="<?php echo $lang_a; ?>" href="<?php echo $perma_a_link; ?>" title="<?php the_title(); ?>" ><?php echo $perma_a_link; ?></a>
Viewing 2 replies - 1 through 2 (of 2 total)