Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Function_img_cat($post_id){
- global $post;
- $theme_url = "http://www.redminka.com/wp-content/themes/redminkaepik";
- $img_featured = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'medium');
- if ( in_category('notas') ) {
- $url_imagen = $theme_url.'/img/nota100.png';
- }else if ( in_category('enlaces') ) {
- $enlaces_link = get_post_meta( $post->ID, 'url_link', true );
- $enlaces_link_corregido = addhttp($enlaces_link);
- $url_imagen = 'http://s.wordpress.com/mshots/v1/'.$enlaces_link.'?w=400';
- }else if ( in_category('fotos') ) {
- $url_imagen = $img_featured;
- }else if ( in_category('videos') ) {
- $video_embed = get_post_meta($post->ID, 'url_video', true);
- $url_imagen = 'http://img.youtube.com/vi/' .substr($video_embed, -11). '/0.jpg"';
- }else if ( in_category('documentos') ) {
- $url_imagen = $theme_url.'/img/documento-descargar-100v2.png';
- }else if ( in_category('articulos') ) {
- $url_imagen = $img_featured;
- }else {}
- update_post_meta($post->ID, 'img_categoria', $url_imagen);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement