Contextual Links not appearing for blocks I have contextual links enabled. I've added 

print render($action_links);


to both my page template and every block template I have but it's always blank. Out of desperation, I set permissions to allow even anonymous users. Still nothing.

I read that Devel might mess with contextual links but I don't have it enabled.

EDIT:

&lt;?php print render($title_suffix); ?&gt;
&lt;?php print render($action_links); ?&gt;
&lt;div style="border: 1px solid #044faa"&gt;
   &lt;div style="background: #044faa; color: #fff; padding: 5px 15px; font-size: 16px"&gt;&lt;strong&gt;&lt;?php echo $block-&gt;title; ?&gt;&lt;/strong&gt;&lt;/div&gt;

   &lt;div style="padding: 5px 0; text-align: center"&gt;&lt;?php
   echo preg_replace("/(&lt;)[\/]?[p](&gt;)/is", "", $content);
   ?&gt;&lt;/div&gt;
&lt;/div&gt;
Contextual links are printed with:

print render($title_suffix);


I Have checked it on block.tpl.php

See: Working with contextual links

I would suggest not to put inline css in your template.
Here working code:

&lt;div id="&lt;?php print $block_html_id; ?&gt;" class="&lt;?php print $classes; ?&gt; clearfix" &lt;?php print $attributes; ?&gt;&gt;
  &lt;?php print render($title_prefix); ?&gt;
  &lt;?php if ($title): ?&gt;
    &lt;div &lt;?php print $title_attributes; ?&gt; style="background: #044faa; color: #fff; padding: 5px 15px; font-size: 16px"&gt;
     &lt;strong&gt;&lt;?php print $title; ?&gt;&lt;/strong&gt;
   &lt;/div&gt;
  &lt;?php endif; ?&gt;
  &lt;?php print render($title_suffix); ?&gt;
  &lt;div style="border: 1px solid #044faa"&gt;
    &lt;div style="padding: 5px 0; text-align: center"&gt;
      &lt;?php print preg_replace("/(&lt;)[\/]?[p](&gt;)/is", "", $content); ?&gt;
  &lt;/div&gt;
&lt;/div&gt;