Deprecated: Assigning the return value of new by reference is deprecated in /home/users/0/lolipop.jp-s1130193/web/feye/wp-settings.php on line 520

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/0/lolipop.jp-s1130193/web/feye/wp-settings.php on line 535

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/0/lolipop.jp-s1130193/web/feye/wp-settings.php on line 542

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/0/lolipop.jp-s1130193/web/feye/wp-settings.php on line 578

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/users/0/lolipop.jp-s1130193/web/feye/wp-settings.php on line 18
Archive for 6 月 1st, 2012 « Fの視点

Archive for 6 月 1st, 2012

wordpressでのOGP設定最適化

by fujii | 6 月 1st, 2012 

作ってたサイトで、モロに以下のサイトのような問題が起きました。
Facebookのいいね数がおかしい・シェアしてもトップページのURLしか出てこないバグの対処法
なので、これらの記事を参考にOGPを最適化。
WordPressでFacebookのいいね!ボタンを不具合無く設置する際のポイント
WordPressで、OGP(The Open Graph Protocol)に完全な情報を反映させる
結果のコードはコレ。
<?php
$post_id = get_the_ID();
$post = get_post($post_id);
$content = $post->post_content;
$content = apply_filters(’the_content’, $content);
$content = strip_tags($content);
$content = str_replace(” “, “”, $content);
$content = str_replace(” ”, “”, $content);
$content = mb_strimwidth($content, 0, 200, “…”);
?>
<meta property=”fb:app_id” content=”アプリID”>
<meta property=”og:title” content=”<?php the_title(); ?>”>
<meta property=”og:type” content=”blog”>
<meta property=”og:url” content=”<?php the_permalink(); ?>”>
<meta property=”og:description” content=”<?php echo $content; ?>”>
<meta property=”og:site_name” content=”<?php bloginfo(’name’); ?>”>
<?php
$str = $post->post_content;
$searchPattern = ‘/<img.*?src=(["\'])(.+?)\1.*?>/i’;
if ( [...]

more from " wordpressでのOGP設定最適化 "...

Comments Off

jqueryのajaxでdataを複数渡したい場合

by fujii | 6 月 1st, 2012 

var data = { value1 : $(’#hoge’).val(), value2 : $(’#fuga’).val() };
と値を複数入れた後、
$.ajax({
type: “POST”,
url: “sample.php”,
data: data
});
という感じで渡します。
受け取る画面(この場合sample.php)では
$_POST['value1']
$_POST['value2']
でそれぞれ値を受け取れます。

more from " jqueryのajaxでdataを複数渡したい場合 "...

Comments Off

WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera