load src of images that attachs in wordpress’s post

The following line is incorrect as showposts is deprecated. $recent = new WP_Query(“showposts=30”); Instead use, $recent = new WP_Query(‘posts_per_page=30’); Following that, Does the thumbnail size of 80×80 exist? array(80,80) If not try any of, $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), small ); $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), medium ); $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), large ); Remember each of … Read more

A problem in loading index.php

WordPress is doing exactly what you’re telling it to do, based on the Template Hierarchy and your Reading Settings. The first thing to understand is that WordPress uses index.php as the default fallback template file for all contexts, and not as the site front page template. The second thing to understand is that the template … Read more

custom theme’s search not working

See the Codex page for Template Heirarchy – https://codex.wordpress.org/Template_Hierarchy#Search_Result_display Based on the links you provided, I’d guess the error stems from using a “static” index page. If your index.php file doesn’t contain a loop to iterate through posts, it won’t display any search results. You can retain a “static” index if you create a search.php … Read more

Display recent posts on front page

Try this, <?php $args_latest = array( ‘post_type’ => ‘post’, ‘ignore_sticky_posts’ => 1, ‘posts_per_page’ => 4 ); $the_query = new WP_Query($args_latest); ?> <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> <article> <a href=”https://wordpress.stackexchange.com/questions/155609/<?php the_permalink() ?>”><img src=”https://wordpress.stackexchange.com/questions/155609/<?php bloginfo(“template_directory’); ?>/img/post-images/Adithi_Dinner_blog.jpg” class=”border” alt=”image” /><h1><?php the_title(); ?></h1></a> <p><?php echo substr(strip_tags($post->post_content), 0, 100);?></p> <!– <?php the_content( ‘Read the full … Read more

customize functionality of share buttons under each blog post [closed]

Okay so this will be your jQuery code. <script type=”text/javascript”> $(document).ready(function() { $(‘.thumbup’).on(‘click’, function(){ $(this).parents(‘.entry’).find(“.hidden-like”).toggle(); }); }); </script> But to use it, you will have to change couple of IDs in classes or you can also add classes with IDs. You can not use ID as you wish. The id attribute specifies a unique id … Read more