How to keep sharing stats after creating 301 redirects?

Got it. I was already using the Advanced Custom Fields plugin so I just created a custom field called “old_url” with that. Then I created a function: function sharingurl () { if(get_field(‘old_url’) == “”) { echo untrailingslashit(get_permalink()); } else { echo get_field(‘old_url’); } } Then I just included <?php sharingurl(); ?> in the data-href and … Read more

Conditionally write open graph meta property in header

From what I understand, you need help framing your if logic? And the php tags usage dont look right either. Does this help – <?php if(!is_single()){ if(is_home() || is_front_page()){ // not sure if you have set a static page as your front page echo ‘<meta property=”og:url” content=”‘.bloginfo(‘url’); .'” />’; }elseif(is_tag()){ echo ‘<meta property=”og:url” content=”‘.$_SERVER[“HTTP_HOST”] . … Read more

FaceBook fan-block in a text-widget

You will need to include both pieces of code in the text widget like this. BTW, When you pasted your code, you missed a > in </script>. I fixed it in my edit and answer <div id=”fb-root”></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)