rucativava
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Add Excerpt as meta description without and tagsDidn’t work for me. This is my output:
<meta property="og:description" content="… <a href="https://www.aaaaa.com/jjjjjj/lllllll/" class="read_more">[read more]</a>" />
Forum: Hacks
In reply to: Attach code to image with named attributesJust to let you know that, not finding any other information, I followed your advice successfully.
I used this https://codex.www.ads-software.com/Plugin_API/Filter_Reference/the_content and this
https://php.net/manual/en/ref.strings.php .
Maybe I might as well paste the code I wrote here, in case somebody stumbles upon this post and gets curious about my smudgy bites:function modify_capa($content) { if(in_array('get_the_excerpt', $GLOBALS['wp_current_filter'])) return $content; if (strpos($content,'alt="capa"')): ?> <?php // FIND CAPA $capapos = stripos($content,'capa'); $imgend = strpos($content,'>',$capapos); $imgend = $imgend; $content_length = strlen($content); $imgend_fromend = -1*($content_length - $imgend); $imgstart = strrpos($content,'<',$imgend_fromend); $img_length = $imgend - $imgstart+1; $capa_img_tag = substr($content, $imgstart, $img_length); //FIND ATTACHMENT ID $id_start = strpos($capa_img_tag,'wp-image'); $id_end = strpos($capa_img_tag,' ',$id_start); $id_string = substr($capa_img_tag, $id_start,$id_end-$id_start); $capa_id = substr($id_string,strrpos($id_string, '-',-1)+1); $capa = wp_get_attachment_image_src( $capa_id,'publication'); $new_capa = '<img class="capa-shadow" src="'.$capa[0].'" alt="capa" width="'.$capa[1].'" height="'.$capa[2].'" />'; echo $new_capa; ?> <?php //INSERT NEW CODE ?> <div> HTML stuff <?php echo 'with php stuff'; ?> </div> <?php //REMOVE OLD CAPA $content = str_ireplace($capa_img_tag,'',$content); endif; return $content; } add_filter( 'the_content', 'modify_capa' );
Forum: Themes and Templates
In reply to: Output images in specific image_sizeRaby:
I think we’re on the right track. That is what I want. Some kind of function that will override what is written in the post. From what I understand, your code will override any image dimensions with the given ‘SIZE_YOU_WANT’ dimensions.
Do you know how can I limit this update_option() to a specific part of my .php file? e.g.: single.php main loop.Forum: Themes and Templates
In reply to: Output images in specific image_sizeI am using WordPress as a CMS for this project. Posts will work as containers of information on specific products. My client needs to alternate some images with text – the post editor is perfect for this; but I want to override possible mistakes made by him regarding chosen image size. That is why I need to override the output image_size with the one I already created through add_image_size(‘post-width’,750,500).
Forum: Themes and Templates
In reply to: Output images in specific image_sizeI want to use the wordpress crunched images because it is the most optimized way in terms of size (kb). Javascript and CSS might present two problems:
1 – If the given image in the_content() is smaller, I’ll get a blurred bigger one.
2 – If the given image in the_content() is bigger, I’ll waste bandwidth and memory.
Since WordPress is a CMS that handles resizing images, isn’t it normal to be able to use these kind of functionality?Forum: Themes and Templates
In reply to: Output images in specific image_sizeThat is a real pitty, that you cannot manipulate the content of the_content(). Neither with filters or such?
Forum: Themes and Templates
In reply to: Output images in specific image_sizeThank you for the link. I’ve been there already, and I’ve been using these add_image_size() thoroughly in my template when I know the ID of the attachment.
What I need to know is how to make all images in a post be output with a specific image size in the course of the_content().
Forum: Themes and Templates
In reply to: Output images in specific image_sizeThat is one way, the wrong one in my opinion.
I want it to happen server side, while wp renders the page, and uses its crunched images in the add_image_size() i created in funtions.php .Yes, please.
Forum: Plugins
In reply to: [Sharpen Resized Images] [Plugin: Sharpen Resized Images] ExamplesUnsal,
Thank you for adding this functionality. So the way to adjust sharpening is through tinkering those 3 numbers? Is there a way to choose a number in a 0-10 scale?