Alter the image used for a user who has not uploaded a custom image yet

Here’s a function you can put in your theme’s functions.php file to force your own default avatar. Update the $myavatar line to point to your image path/name: // Adds a new default avatar to the list in WordPress admin add_filter( ‘avatar_defaults’, ‘mytheme_addgravatar’ ); function mytheme_addgravatar( $avatar_defaults ) { $myavatar = get_bloginfo(‘stylesheet_directory’) . ‘/images/my-avatar.gif’; $avatar_defaults[$myavatar] = … Read more

how can display a post on home screen without images

This should help you.. <?php function remove_images( $content ) { //Run only on the front page, in your case the homepage if(is_front_page()) { //Remove the images $postOutput = preg_replace(‘/<img\b[^>]++>/i’,”, $content); //Get the first 200 characters only, you can change the number if you want $postOutput = wp_html_excerpt($postOutput, 200); return $postOutput; } return $content; } add_filter( … Read more

changing the default picture size link url

You can use: <?php $image_attributes = wp_get_attachment_image_src( $attachment_id, array(1024,1024) ); ?> <a href=”https://wordpress.stackexchange.com/questions/37124/<?php echo $image_attributes[0]; ?>”>xxx</a> See http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src If the picture is too small the original will show, otherwise cropped version (1024×1024). Update: Didn’t understand your question correct. Here is what you need: First of all add a thumbnail size for your custom max size … Read more

Add images to my theme with html

<img src = “https://wordpress.stackexchange.com/questions/38936/<?php bloginfo(“stylesheet_directory’);?>/images/file.png” /> http://codex.wordpress.org/Function_Reference/bloginfo

Regarding Posts

for your first quetion : you can either use the excerpt() instead of the_content() in your loop, or you can use this function below : function limitcontent($limit) { $content = explode(‘ ‘, get_the_content(), $limit); if (count($content)>=$limit) { array_pop($content); $content = implode(” “,$content).’…’; } else { $content = implode(” “,$content); } $content = preg_replace(‘/\[.+\]/’,”, $content); $content … Read more