Front end post or photo or both

I’ve made a similar form before, and it works whether it has a post or not. This form does not use wp_editor, but you can just modify the code to suit your need. add_action(‘wp_ajax_add_story’, ‘process_story_entry’); function process_story_entry() { global $current_user; if ( empty($_POST) || !wp_verify_nonce($_POST[$current_user->user_login],’add_story’) ) { echo ‘You targeted the right function, but sorry, … Read more

How to Add a Website Background Image to One Page?

Use Conditional Tags: http://codex.wordpress.org/Conditional_Tags Or a custom template for homepage: http://codex.wordpress.org/Stepping_Into_Templates Then it’s a matter of applying a style / class when, for example, is_front_page() (or sometimes) is_home() (for conditionals), or on your custom template. It’s mostly a matter of CSS then. Update/Alternative: Use Chrome to learn body class. Apply style accordingly: body.home { background:url(images/home_background.png) … Read more

How can we see which posts don’t have a featured image or it doesn’t exist anymore?

In form of a shortcode: add_shortcode(‘nofeatures’, ‘wpse_51768_shortcode’); function wpse_51768_shortcode() { $posts = get_posts( array(‘numberposts’ => -1) ); foreach ( $posts as $post ) { $featured = get_the_post_thumbnail( $post->ID, ‘thumbnail’, null ); if ( $featured ) echo ‘Has Featured Image: ‘ . $post->post_title . ‘<br />’; } } [update] The following outputs the posts that don’t … Read more

Why is inline CSS added to images automatically? [closed]

Before you ask a question: maybe check on a other install of WP, is this the default? It is not? The problem is very often from plugins or themes. Disable plugins and switch to the default theme, current Twenty Twelve and check your problem. The current release 3.5 and 3.4* have not this insert as … Read more

Orientation of featured image in post?

Basic check of aspect ratio. Display as landscape, square or portrait if ( !has_post_thumbnail()) { return ‘Error’; } else { $image = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ”); $image_w = $image[1]; $image_h = $image[2]; if ($image_w > $image_h) { echo ‘landscape’; } elseif ($image_w == $image_h) { echo ‘square’; } else { echo ‘portrait’; } }

What type to upload image within theme options?

If using image radio buttons, define a directory path here is code. I hope its going work. $imagepath = get_template_directory_uri() . ‘/images/’; $options = array(); $options[] = array( “name” => __(‘Logo’, ‘prothemeus’), “desc” => __(‘Upload your logo’, ‘prothemeus’), “id” => “pt_logo”, “type” => “upload”);