add_theme_support not outputting thumbnails
You need to echo the get_post_thumbnail in order for it to output. echo get_the_post_thumbnail($post->ID,’thumbnail’);
You need to echo the get_post_thumbnail in order for it to output. echo get_the_post_thumbnail($post->ID,’thumbnail’);
Your description of the problem is not very clear, and your inconsistent code formatting makes that hard to read (plus I am pretty sure some code is missing), but if the problem is running the query multiple times you can solve that with a static variable. function get_gametitle_info() { static $game_info_query = false; if (false … Read more
I use something like this in my header.php: <title> <?php if(is_front_page()) echo “Front Page Title”; else if(is_404()) echo “Page Not Found”; else the_title(); echo ‘ | ‘.get_bloginfo(‘name’); ?> </title> Check out Conditional Tags for more information. As a Function() : functions.php function setTitle(){ global $post; $title = get_the_title(); $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), … Read more
As the $posts are the posts of post_type abschreibungstabelle, you can get the custom field values by using get_post_custom_values if( ! $posts ) return; $out=”<select id=”afa_select”><option>Anlagegut auswählen</option>”; foreach( $posts as $p ) { $custom_field_value = get_post_custom_values( ‘nutzungsdauer’, $p->ID ); // Now you can use the value the way you want $out .= ‘<option value=”‘ . … Read more
found a solution: thought it might be worth sharing… //// We use $gallery_media as an array containing all attachment IDs that have been approved by the admin before $args = array( ‘post_type’ => ‘attachment’, ‘posts_per_page’ => -1, ‘orderby’ => ‘post_date’, ‘order’ => ‘ASC’, ‘post_status’ =>’any’, ‘post_parent’ => $post->ID, // This queries a custom field I … Read more
After some help with a PHP developer, it seems the main code above was close but certain changes were made. Here is the code for those interested. In this code, the custom post type is: Course. Change accordingly if needed for your own use. function save_educadme_courses_for_user( $user_id ) { if ( !current_user_can( ‘edit_user’, $user_id ) … Read more
The media uploader wraps the image and caption in the shortcode. There is a filter called img_caption_shortcode that can do what you want. The caption itself is passed as part of an array to the shortcode handler, as is the image id. add_filter( ‘img_caption_shortcode’, ‘wwm_img_caption_filter’, 10, 3 ); function wwm_img_caption_filter( $empty, $attr, $content ) { … Read more
Including one page with WordPress functions into another
How to Update User Meta Field other than from profile?
It seems if you use classes you have to use array($this, $function)); in the function element as shown below. add_submenu_page( $mainmenu_slug, $submenu_title, $submenu_label, $capability, $submenu_slug , array($this, $submenu_function) );