Creating interactive drop down lists in a post [closed]

Unfortunately unless there’s a plugin you can’t do this custom code (javascript) on wordpress.com – see “Javascript” section on this page. You could do this on a self-hosted wordpress.org site using a plugin like this: Ajax Dropdowns You might be able to use a form builder and then iframe it in to your page like … Read more

call a function when insert and update a custom post type

This is the original answer but it is little faulty, look below for the updated You can use following approach. The my_action_updated_post_meta is executed after the post insert or update is done: // define the updated_post_meta callback function my_action_updated_post_meta( $array, $int, $int ) { global $post; // see your updated post print_r($post); // make your … Read more

including 404 page in post page

The most efficient way to do it would be to have a whitelist of pages, and to check the requested page against that list before the query is run. function my_parse_query( $wp_query ) { if( isset( $wp_query->query_vars[‘sub_pages’] ) ){ $sub_pages = array( ‘example’, ‘another’ ); if( ! in_array( $wp_query->query_vars[‘sub_pages’], $sub_pages ) ){ $wp_query->set_404(); status_header( 404 … Read more

How to Get Position of a Post from a category and tag

Well, I fixed my own problem. If someone needs it in the future, you can use the code below: $query = new WP_Query( array( ‘cat’ => ’22’, ‘posts_per_page’ => -1, ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘meta_key_here’, ‘order’ => ‘DESC’, ‘fields’ => ‘ids’ )); global $post; $i = array_search( $post->ID, $query->posts ) + 1; echo ‘<div … Read more

Connection dropped due to file size

It sounds like you are attempting to push too much data at one time. GoDaddy may be terminating the connection because of a size limit per request or the upload is taking longer than they allow (because it is so large.) In either case it is a sign the amount of data is too large. … Read more

Start loop from specific post ID

I’m not sure I understand what you are trying to achive, but I suspect you want to: – show current post in carousel – show all other posts (without post shown before) – single post If thats what you need one more loop – so you can first show your current post, then to show … Read more

previous and next post of same category on singlepost.php

I would not use get_posts() to setup my loop on the single.php page. I would just use the normal proper loop. Please check out this page in the codex about Theme Development Here is an example of a single.php that will work as expected <div id=”primary” class=”content-area”> <div id=”content” class=”site-content” role=”main”> <?php // Start the … Read more