Twenty Eleven theme, how to change style to a specific “format”

Targeting the whole page First, ensure that you’re calling body_class() inside of the HTML <body> tag: <body <?php body_class(); ?> Then, you can take advantage of the post format-specific classes output by body_class() to style according to your needs. Single blog posts use the class single-post-format-{format} body.single-format-aside {} Archive index pages for a post format … Read more

Function in functions.php by url

You can check for the presence of a specific query variable, so http://www.example.com?my_listener=test. You check for this on the init hook and if it isn’t there you just quit early and WP goes about it’s business. If it is there, you can then do something, just don’t forget to exit at the end or the … Read more

How to add a class and title attribute to the link generated by next/previous post

previous_post and next_post are deprecated. you should be using previous_post_link and next_post_link. That function applies the {$adjacent}_post_link filter. You can use that to get what you want. A very, very crude example: function construct_np_attr_wpse_92086($matches) { if (‘prev’ == $matches[1]) { $np = ‘Previous’; } else { $np = ‘Next’; } $ret=”rel=””.$matches[1].'” class=”normalTip” ‘; if (!empty($np)) … Read more

Create a new page for each form selection

I can’t comment yet, so I’ll tell you here what you can change immediately: $countryinfo = $wpdb->get_row(“SELECT * FROM wp_num_countries WHERE countryID = “.$country_id); to $countryinfo = $wpdb->get_row($wpdb->prepare(“SELECT * FROM wp_num_countries WHERE countryID = %d”, $country_id)); because you directly use $_POST variable, so $wpdb->prepare will format and prepare your query string. But that code looks … Read more

Adding Relevant Post Images

This plugin sounds like what you’re looking for. It uses post tags to find all relevant posts. Upload it to your plugins directory and activate it. Then just decide where you want it on your site and add post tags to get content to relate to each other. http://wordpress.org/extend/plugins/igit-related-posts-with-thumb-images-after-posts/ Note. I am not the developer … Read more

Filter image and text from post format

I’m pretty sure you’d define the custom post formats in functions.php, then they’d reference their own PHP file which contains the loop you’d need. So for example, Text format would go to post-text.php, Image format post-image.php, etc. You could add your match filters into a function within functions.php, and then call the function from within … Read more