How to display posts on a static page? (like search loop)

You could use query_posts() to set up a new loop in your page. Assuming that the posts you want are in the category ‘Noticias’, with a slug of ‘noticias’: query_posts( ‘category=noticias’ ); if( have_posts() ) { get_template_part( ‘loop’, ‘index’ ); } wp_reset_query(); // probably not necessary, if you don’t have a pre-existing Loop

delete_post hook – deleting multiple items

That’s not how that hook is meant to be used: do_action( ‘delete_post’, int $postid, WP_Post $post ) https://developer.wordpress.org/reference/hooks/delete_post/ The action gives you the post ID and a post object. So don’t access $_GET or the global $post object, instead use the what the action gives you.

Extracting post categories

WordPress has a table called *wp_term_relationships* to keep track of several types of relationships, including post – category. Let’s go table by table: wp_posts – holds all posts,pages, and other content. You want to poll all rows that have -> post_type = post . You might want to poll only published posts -> post_status = … Read more

Too many connections to server

I contacted my hosting provider to solve this problem and they claim that my wordpress is generating too many simultaneous connections to server… The only times I’ve seen hosts put limits on the number of MySQL connections is when the host is free or very cheap or incompetent. Is it free hosting? It’s really easiest … Read more

Create posts under certain page

You can assign any page– “Page”, not blog post or CPT post/page– to be the “blog posts” page by going to wp-admin->Settings->Reading, clicking the “A static page” radio box and selecting a static home page and blog page from the drop down menus. If that isn’t what you want, or if that doesn’t work, then … Read more

How Can I Query a Specific Page From a MultiPage paginated Post

WordPress uses the PHP explode function to split the content into a array of ‘pages’. Happens in the setup_postdata function with this code: $pages = explode(”, $content); source So you could do something like : function wpse_103026( $content, $pagenum ) { if ( strpos( $content, ‘<!–nextpage–>’ ) ) { $pages = explode(‘<!–nextpage–>’, $content); return isset … Read more

Page Navigation for list of post

Not sure about all the other custom stuff you’re running in there. But looks like you have taken a few tutorials and maybe mashed them together. I think something simple like this might work for you, then you can add some bells and whistles or try for paged navigation later. This will get you regular … Read more