Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Finally got the solution. (:<br> Thanks everybody for helping..</p> <p>So basically all you need to do is remove the default <code>&lt;h1 class="entry-title"&gt;&lt;?php the_title();?&gt;&lt;/h1&gt;</code> from your <code>single.php</code> and/or <code>index.php</code> (for default themes)</p> <p>Add the below function in <code>functions.php</code>:</p> <pre><code>function coreimg($atts) { // Just add the below shortcode in the post. // [cover src='http://localhost/wordpress/wp-content/uploads/2010/06/flyingkite.jpg' title='A flying Kite'] global $post; extract(shortcode_atts(array('src' =&gt; '', 'title' =&gt; '' ), $atts)); if($src == '') { $src = get_bloginfo('template_directory') . '/rotate.php'; } if ($title == '') { $title = "{$post-&gt;post_title}"; } $coverup = '&lt;a href="'; $coverup .= get_permalink($post-&gt;ID); $coverup .= '" ' . "alt='{$title}' title='{$title}' class='corecover'&gt;&lt;img src='"; $coverup .= "{$src}' class='cocover' alt='{$title}' title='{$title}' /&gt;&lt;/a&gt;"; $before = '&lt;h1 class="entry-title"&gt;&lt;a href="' . get_permalink($post-&gt;ID) .'" title="' . "{$post-&gt;post_title}\"&gt;"; $after = '&lt;/a&gt;&lt;/h1&gt;'; $output = "{$coverup}{$before}{$post-&gt;post_title}{$after}"; return $output; } add_shortcode('cover', 'coreimg'); </code></pre> <p>You can grab the <code>random.php</code> file from <a href="http://www.alistapart.com/articles/randomizer/" rel="nofollow">alistapart</a>.</p> <h1>What does it do <em>(special)</em>?</h1> <p>If by default you haven't specified any specific image for the post it rotates random header images that you can upload in a folder (and specify in <code>random.php</code>) . The shortcode for this might seem like <code>[cover title="The flying kite"]</code> or just <code>[cover]</code>. for complete url shortcode you can type in <code>[cover src="../mykite.png"]</code> or <code>[cover src="../mykite.png" title="Hey, look a kite!"]</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload