Get the post attached to a image attachment
Roughly this: $parent = get_post_field( ‘post_parent’, $id); $link = get_permalink($parent);
Roughly this: $parent = get_post_field( ‘post_parent’, $id); $link = get_permalink($parent);
You should be able to use template_redirect. I haven’t tested it though, should be something like this. function page_redirect() { if ($_SERVER[‘REQUEST_URI’] == ‘your_url’) { require(TEMPLATEPATH . ‘/mY-account.php’); } } add_action(‘template_redirect’, ‘page_redirect’);
WordPress has a simpler function for what you’re trying to do, add_rewrite_endpoint. Additionally, the filter for a single post template is single_template, page_template fires on the page post type. function wpd_detail_endpoint(){ add_rewrite_endpoint( ‘detail’, EP_PERMALINK ); } add_action( ‘init’, ‘wpd_detail_endpoint’ ); function wpd_detail_template( $template=”” ) { global $wp_query; if( ! array_key_exists( ‘detail’, $wp_query->query_vars ) ) return … Read more
Pretty sure you can’t match multiple taxonomy terms in a query–Wordpress will only honor the first one and ignore the rest. Apparently, this is scheduled to be fixed in 3.1. In the meantime, there is a plugin that’ll fix you right up: http://scribu.net/wordpress/query-multiple-taxonomies EDIT: If you want a non-plugin solution, let me know. I’ve got … Read more
have a look at the file wp-admin/includes/import.php, you’ll find the necessary functions in there.
The reason is that if you are on page 1, the data that is posted to be saved is an array of the form: XX_theme_settings=array(‘XX_Option1′ =>’input1′,’XX_Option2’=>’input2′,…) and contains no data from page 2. This is because the input from page 2 is not posted with it (since it wasn’t in the same <form> – it’s … Read more
You can hook into wp_insert_post_data and change things. <?php add_filter(‘wp_insert_post_data’, ‘wpse67262_change_title’); function wpse67262_change_title($data) { $data[‘post_title’] = ‘This will change the title’; return $data; } Obviously you’re going to have to some checks and stuff so you don’t change every post title. That hook will also fire every time the post is saved (adding a new … Read more
cat takes a comma deliminated list, so ‘-98,-92’ Further reading http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters
About your considerations:- Yes true! It will update the page on every visit. The database will be updated more frequently based on which user making a request. But there will be no incorrect output. The better way I suggest using a template_include filter. Assign a static front page then apply the template to that page … Read more
Basically you need to add the html of the select dropdown at your function inventory_information() which is the function that actually displays the metabox: // The Event Location Metabox function inventory_information() { global $post; // Noncename needed to verify where the data originated echo ‘<input type=”hidden” name=”inventorymeta_noncename” id=”inventorymeta_noncename” value=”‘ . wp_create_nonce( plugin_basename(__FILE__) ) . ‘” … Read more