RSS Feed in Custom Field
You might be able to put this into your template wherever you want to display the RSS custom field: get_post_meta($post->ID, ‘custom field name’, true);
You might be able to put this into your template wherever you want to display the RSS custom field: get_post_meta($post->ID, ‘custom field name’, true);
Add the PDF attachment ID as a custom field value, for example attached_pdf_id. Get the URL using wp_get_attachment_url(): <?php if ( is_user_logged_in() ) { $pdf_link = wp_get_attachment_url( get_post_meta( get_the_ID(), ‘attached_pdf_id’, true ) ); if ( $pdf_link ) { ?><a href = “https://wordpress.stackexchange.com/questions/89809/<?php echo $pdf_link ?>” >Download</a><?php } else { ?>Sorry, no link available. Please contact … Read more
The value of index ‘link’ of the array $plane_details is a string, and thus $value[0] gives you the first letter only. Just replace $value[0] by $value and all should be fine. Why are you referencing the value this way, anyway?
As a general rule of thumb it’s a good practice not to “create” hooks within your theme. Last year Tom McFarlin wrote against placing custom hooks in your theme; however, if you are building an addon plugin (such as WooThemes and their Features plugin) it would make a grey area exception to include those hooks. … Read more
There is no template for “/widget”. Templates are about content types and not URL fragments. IMO your page hack is totally legit. Another way to handle this is to have a widgets category which is the parent of all other categories and change your permalink structure to /%category%/%postname%/
I fixed this in the end. There is a button in the wpsc settings page under presentation to flush the theme cache. Caption: If you have moved your files in some other way i.e FTP, you may need to click the Flush Theme Cache. This will refresh the locations WordPress looks for your templates. Simple, … Read more
I managed to solve this in a procedural way: 1 added in theme function this snippet: add_action(‘template_redirect’, ‘load_category_tree_template’); function load_category_tree_template() { if (is_category() && !is_feed()) { // replace ‘your-base-category-slug’ with the slug of root category $base_tree_cat_id = get_cat_id(‘your-base-category-slug’); // get current category id $catid = get_query_var(‘cat’); if (is_category($base_tree_cat_id) || cat_is_ancestor_of($base_tree_cat_id, $catid)) { load_template(STYLESHEETPATH . ‘/category-your-base-category-slug.php’); … Read more
Looping through posts First of all, you need to have two separate loops – one for whatever it is that it’s displaying right now and second one for your custom post type. Right now the block where you want your custom posts to appear is located within the first loop, and that’s not good. I … Read more
You would have to put your code in your question into a function. Maybe something like function wpse_91897_get_image() { }. Then try the code below. I haven’t tested this but it should work. function wpse_91897_display($content) { global $single; $output = wpse_91897_get_image(); if (is_single()) { return $content . $output; } else { return $content; } } … Read more
Use the code validator at http://validator.w3.org/ to find and fix a missing closing </div> tag or other html errors that are causing the display problem.