How to show view all posts from front page?

It’s partially depends upon your themes functions or plugin like Visual Composer. On the other hand, there is some plugins – Display Posts or Yearly Archive, which can display all the posts. or Create a custom page template and include the following code <?php // the query $wpb_all_query = new WP_Query(array(‘post_type’=>’post’, ‘post_status’=>’publish’, ‘posts_per_page’=>-1)); ?> <?php … Read more

Add in the url attachment loop the wp_link_pages of the post

In order to get the parent post, you would use the wp_get_post_parent_id() function. So in your foreach loop, you would want to add something like: $parent = wp_get_post_parent_id( $attachment->ID ); <a href=”https://wordpress.stackexchange.com/questions/260459/<?php esc_url( the_permalink( $parent ) ) ?>”> // Rest of your HTML </a>

Show posts from last 3 years in posts page

You should adapt it to fit your needs, e.g. (not tested) : // Create a new filtering function that will add our where clause to the query function filter_where( $where=”” ) { $where .= ” AND post_date > ‘” . date(‘Y-m-d’, strtotime(‘-1 year’)) . “‘”; return $where; }<br> add_filter( ‘posts_where’, ‘filter_where’ ); $query = new … Read more

Show post excerpt

One option would be to use substr in your function: function my_excerpt($limit) { $excerpt = get_the_excerpt(); if(strlen($excerpt) > $limit) { // trim to $limit characters $excerpt = substr($excerpt, 0, $limit); // remove any truncated words $excerpt = substr($excerpt, 0, strippos($excerpt, ” “)); $excerpt = trim(preg_replace(‘/\s+/’, ‘ ‘, $excerpt)); } return $excerpt; } Another way is … Read more

Manipulating images inside post content

Because the old image_send_to_editor function did NOT include the wp-image-xxxxx class with the image ID, we have to make database queries to find the correct ID for a given image. Making database queries for every image does not seem like a good idea. The only real solution is to manually delete and re-add the images … Read more