Tinymce shortcodes within shortcode contents
Tinymce shortcodes within shortcode contents
Tinymce shortcodes within shortcode contents
If the posts are already shown on your page, just with a bunch of unnecessary text that you want to take away, do the following: 1. Open the template file of your homepage (it can be named different in different themes, so impossible to give you the exact name of file, but usually they are … Read more
Base on the updated code, the answer to your question, “How can I add filter or query to show the most views post (new posts) of last 24 hours?” is that you can’t do that. Your code is not tracking time at all. There is no way to pull ‘last 24 hours’ if you aren’t … Read more
They are filtered via the views_[screen-id] filter. The screen-id of the edit post page is edit-post, so you can modify the links like this: add_action( ‘views_edit-post’, ‘wpse17484_views_edit_post’ ); function wpse17484_views_edit_post( $views ) { $views[‘wpse17484’] = ‘<a href=”https://wordpress.stackexchange.com/questions/17484/my-url”>My action</a>’; return $views; } You can see the code that generates the post views in WP_Posts_List_Table::get_views().
You can automatically add a custom field to each new post on publish (on change status to publish). And then set it’s value to a random number between 829 and 1013. Here is the function that will do just that. // Create custom field on post publish function wpse_custom_field_on_publish( $new, $old, $post ) { if … Read more
There is a Jetpack widget called Top Posts and Pages (Jetpack) If you check out the [source code][2] for this widget, you can see that it’s using the function stats_get_csv() to retrieve the stats: $post_view_posts = stats_get_csv( ‘postviews’, array( ‘days’ => 2, ‘limit’ => 10 ) ); If you want to generate your custom most … Read more
This won’t work if page caching is enabled, I would recommend creating an ajax request which calls this function instead. e.g. add_action( “wp_ajax_nopriv_view_count”, ‘view_count’ ); add_action( “wp_ajax_view_count”, ‘view_count’ ); function view_count(){ update_post_meta($_GET[‘id’], ‘view_count’, $count++); } (then create an ajax call in JS which passes through the page id to this counting function) Ajax shouldn’t be … Read more
To change the mode URL variable but in the load try this: add_action( ‘load-edit.php’, ‘my_default_posts_list_mode’ ); function my_default_posts_list_mode() { $post_type = isset( $_GET[‘post_type’] ) ? $_GET[‘post_type’] : ”; if ( $post_type && $post_type == ‘my_post_type’ && !isset( $_REQUEST[‘mode’] ) ) $_REQUEST[‘mode’] = ‘excerpt’; } Got the “insipration” from here: Set Default Listing “View” in Admin
I had a lot of trouble finding information and examples of this, so here you go: https://github.com/dtbaker/wordpress-mce-view-and-shortcode-editor This converts a [shortcode] into a nice custom view to match the frontend, and adds an edit button for easy shortcode editing. <?php /** * Class dtbaker_Shortcode_Banner * handles the creation of [boutique_banner] shortcode * adds a button … Read more
For example, let’s say that Property is the post type. We would like to display several different views (completed (built), for sale, and for rent.) Sure. Just make Completed, For Sale, and For Rent taxonomies for the Property post type. Look into WP_Rewrite class, too, and you can get greater control over url permalink structure.