How does WordPress insert Paragraphs in posts
The content is run through the wpautop filter (there’s a lot about that on Google).
The content is run through the wpautop filter (there’s a lot about that on Google).
There is a parameter in WP_Query called post_parent. Normally this refers to the ID of the post’s parent, but since its an integer field, pages without a parent have in essence a post_parent of 0. So, to get all pages that are not child pages of another page, you could use query_posts( ‘post_type=page&post_parent=0’ ); or, … Read more
Dan, First a advice: don’t use query_posts to get your pages. Use get_pages instead. Here is how you can do what you are asking using get_pages. get_pages( array( ‘parent’ => 0, ‘sort_column’ => ‘menu_order’ ) ); You can also specify whether you want to sort in ascending order or in descending order. Default sorting order … Read more
You can use pre_get_posts hoot to filter the search query to selected sectors only, something like this: function Search_with_in_a_tax( &$query ) { if ( is_search() && isset($_GET[‘sector_array’])) { $tax_query = array( array( ‘taxonomy’ => ‘news’, ‘terms’ => $_GET[‘sector_array’], ‘field’ => ‘term_id’, ) ); //turn it into a WP_Tax_Query object $tax_query = new WP_Tax_Query($tax_query); $query->set(“tax_query”, $tax_query); … Read more
It might actually still work, but the syntax is currently wrong (you have a PHP opening tag inside another opening tag). And you can assign the value of the custom field to a variable using the get_field function. What if you try this? <?php // assuming your ACF name is ‘number_of_posts’ $numposts = get_field(‘number_of_posts’); $args … Read more
The Bug …is well known, but it’s not a bug. It’s an Error, that you don’t display. The Fix Move into your ~/wp-config.php file. Then add define( ‘WP_DEBUG’, true ); and read your Error message.
looks like I needed add a path to my cookie. This fixed it: $timer = time()+86400; setcookie(‘alertuser’, ‘1’, $timer, “https://wordpress.stackexchange.com/”); and $timer = time()-86400; setcookie(‘alertuser’, ”, $timer, “https://wordpress.stackexchange.com/”);
Memory is not the issue here. There are no complex operations, and the difference will be almost unmeasurable. What matters is readability: If your stuff function is rather short (less than eight functional steps) and you use the check just once – keep the check in it. But if you need the support check in … Read more
Issue 1: creating the excerpt data This should be fairly easy to do directly with SQL. UPDATE wp_posts AS post INNER JOIN wp_posts AS attachment ON attachment.post_type=”attachment” AND post.ID = attachment.post_parent SET post.post_excerpt = CONCAT(‘<img src=”‘, attachment.guid,'” />’) WHERE post.post_excerpt=””; This is obviously a “one-time fix” that implies you have access to the database. If … Read more
You should probably write a plugin, which has the shortcode function. You can separate the AJAX/jQuery code in a plugin, but not in a shortcode.