Getting a list of the published posts

Which wp_get_recent_posts()do you retrieve the most recent posts. For meta data, like published date and modified date use additional functions. For the published date is the_date() helpful. For the modified date use the_modified_date(). The functions are a part of the Template Tags, useful for Theme and direct output. But she have also parameters to get … Read more

WordPress API functions not working at AJAX functions.php call

Your problem is probably because you do not return a json object but an html (actually mixed text and html), and you set jQuery to validate that the response is json, which it isn’t. your code at the ajax handler should be something like $catshtml = wp_dropdown_categories(…..echo=0); $ret = array(‘data’ => $catshtml); wp_send_json($ret); die(); on … Read more

Action on WordPress Install

The main component you are probably missing is dropping your customizations in an install.php file in the wp-content directory. If you look at the /wp-admin/includes/upgrade.php you will be able to see exactly how it is included and the installation functions you can override. I am not sure if that will be good enough to catch … Read more

Load plugin script in specific page

Just one thing to make sure of, you must put the page id in the brackets for the “is_page()” function. If your page ID was 12, you’d use it like this: if( ! is_page( 12 ) ){ You can find a page’s id by editing it and looking in the URL for “post=”. The Page … Read more

How to request admin-ajax.php correctly when wordpress URL and site URL are different?

admin_url() should be used. However for some websites this request gives error 404 in front-end admin_url(‘admin-ajax.php’) should point to an actual file (admin-ajax.php), as such WordPress won’t pass it through index.php, and so it shouldn’t lead to the theme’s 404 page. (Unless the file has been deleted). … unless you have a .htaccess file which … Read more

How to add filter for wordpress plugin?

You are almost close. add_filter( ‘some_custom_filter’, array( $this, ‘filter_suppress_the_content’ ), 10, 3 ); // the above line states that, the method `filter_suppress_the_content` should have three arguments, where you have used nothing. public function filter_suppress_the_content() { return true; } // comparing your code, this method should have one argument The solution: public function setup_filters() { add_filter( … Read more

Post deleted in trash [closed]

Once a post is moved to the trash and deleted, it’s gone from the database. The only way to recover it is from an earlier database backup. Do you have a backup? Does your webhost have a backup?

How to find the Registration page

This is a buddypress page, linked with the page ID 4275. The body class of your delivered HTML is: <body class=”registration register buddypress page page-id-4275 page-template-default admin-bar no-customize-support no-js”> To edit this page itself, go to http://hoteliersnetworkme.com/wp-admin/post.php?post=4275&action=edit BuddyPress filters the content of this page and adds a registration form. To modify the registration form itself, … Read more