Geolocate Custom Post Type on Save
On post save the ‘save_post’ action is run. You could hook your function that geolocates to that.
On post save the ‘save_post’ action is run. You could hook your function that geolocates to that.
Its never a good idea to store binary data in your database, take a look at this post: https://stackoverflow.com/questions/662488/would-you-store-binary-data-in-database-or-in-file-system and this post: https://stackoverflow.com/questions/5778380/why-store-binary-data-in-mysql In my opinion, its far faster to use the file system and here’s why: The image URL can be stored in a custom field by wordpress – this is very simple to … Read more
Try this: <?php $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); $parent = get_term($term->parent, get_query_var(‘taxonomy’) ); echo $parent->name; ?> You have to get the current term slug and then use get_term by the slug and then echo the name.
Found that it works if I add the edit_posts capacity. But Posts is now visible in Admin 🙁 At the same time, it also fixed a problem I had with Media upload: the user could never edit right after the upload.
Just figured out this one– in the function that load the iframe, add this: if ( !empty($_POST) ) { $return = media_upload_form_handler(); if ( is_string($return) ) return $return; if ( is_array($return) ) $errors = $return; } Then, all the form data get saved as normal.
// 2012-07-11 — turns off hyperlinking of content on Members Profile remove_filter( ‘bp_get_the_profile_field_value’, ‘xprofile_filter_link_profile_data’, 9, 2 );
still don’t know what exactly fixed it. but now it’s all right. i have also found another way to show custom fields: if you want to show a specific field in a specific place, in the CartListDisplayer.php, add to the function lcp_build_post anywhere you like: $lcp_display_output .= get_post_meta($single->ID, ‘featured’, true); where featured is the name … Read more
You can use wp_query with different arguments to list the posts that you want to appear on that specific page (i.e. all the post that are assigned to the X category or all the post that belong to Y author a.s.o). You can find on the WordPress Codex a detailed presentation and examples on how … Read more
I had to modify queries before they run. So the best practice was to add the following code to function.php: if (!function_exists(‘my_theme_filter’)) { function my_theme_filter( $query ){ if ( $query->is_main_query() ) if ( $query->get( ‘tag’ ) OR is_search() ) $query->set( ‘post_type’, array( ‘artprim_item’ ) ); //echo ‘<pre>’; print_r($query); echo ‘</pre>’; return $query; }} add_filter( ‘pre_get_posts’, … Read more
Every file that is uploaded in WordPress is an Attachment, which is a kind of post (‘post_type’ => ‘attachment’). When the file is uploaded inside a Post or Page, it is attached to that particular post/page (‘post_parent’ => $post->ID). I can think of a solution that doesn’t involves any particular coding: you simply have to … Read more