How can I display these posts in ascending order?

Keep in mind that query_posts is best avoided as it has negative effects on the main loop. A better approach would be a new instance of WP_Query or changing the query arguments for the main loop. To get the order you want, try adding the following to your args: array( ‘posts_per_page’ => ‘-1’, ‘post_type’ => … Read more

Ajax calls in wordpress

your ajax url is wrong i think. ajax link should be admin_url( ‘admin-ajax.php’ ). That means wp_localize_script(‘history_script’, ‘myAjax’, array(‘ajaxurl’ => get_template_directory_uri().’/functions.php’)); will be this wp_localize_script(‘history_script’, ‘myAjax’, array(‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ));

What does WordPress mean by they have full rights to content [closed]

This is pretty off-topic — this site is meant for WordPress programming questions — but here’s an answer anyways. If you’re referring to WordPress.com’s Terms of Service, what you are granting WordPress (actually Automattic, WordPress’s parent corporation) is as follows: By submitting Content to Automattic for inclusion on your Website, you grant Automattic a world-wide, … Read more

$attachment->post_title not displaying title

1. the_post_thumbnail… … is a wrapper for echo get_the_post_thumbnail. Hence the echo construct you are using is redundant. That’s not the core of your problem, but worth noting. 2. The empty attributes In your HTML output, the attributes are empty, but they are created. That leads to the likely conclusion, that the culprit is not … Read more

How do I create a template page to show 3 blog posts?

before start your posts loop in a custom page template you need to get posts from database by using wp_query() or get_posts() do some thing like this. $args = array( ‘posts_per_page’ => 3 ); $my_query = new WP_Query($args); // now start your loop if ( $my_query->have_posts() ) { while ( $my_query->have_posts() ) { $my_query->the_post(); // … Read more

How to display only introtext?

While I am sure that the logic of what I am about to post is too simple, I think it should get you started. Your terminology is odd but what it seems you want is to display the “post before the more” part of the post body. To do that, you need to break the … Read more

List posts related to category on a div [closed]

Here is a start. Create a template called content-related.php Inside that paste the following code <?php /** * The default template for displaying realted posts * * @package WordPress * @subpackage Pieter Goosen * @since pietergoosen 1.0 */ wp_reset_postdata(); global $post; // Define shared post arguments $categories = get_the_category($post->ID); if ($categories) : $category_ids = array(); … Read more

How to make posts appear under pages

I’ve been using this template from twenty eleven. I must give great credit here to a great tutorial from digitalraindrops. I have rewritten this to suite my needs and it is currently written to suite the twentyfourteen theme. You can check out the tutorial at the link given above. What I like about this template … Read more