sharing video on facebook from wordpress

That really depends on how the video is embedded into the page. Facebook can only handle specific formats and if it sees something it doesn’t expect, it defaults to a failsafe “show nothing” standard. If the embedded video is well-recognized standard (i.e. YouTube’s default player) it should work just fine. If it’s your own self-hosted … Read more

Generating the ogp tags in theme

If it is a page the global post object is already set when wp_head fires. But you have to get the data for this page with custom code. Pseudo code: add_action ( ‘wp_head’, ‘wpse_58539_get_ogp’ ); function wpse_58539_get_ogp() { if ( ! is_page_template( ‘your-template-name’ ) ) { return; } $page = get_post( $GLOBALS[‘post’] ); // Inspect … Read more

Sharing post in Facebook shows UTF8 invalid character �

I think is not an problem in your WP installation. The site works as encoding UTF-8, also your feed etc. Validating For an validating of strings should use the PHP function mb_check_encoding. A small script should check your database tables, the content so that you have feedback about your data inside the database tables. Also … Read more

How can you upload an image from within a settings page?

WordPress provides a convenient function for just this purpose: wp_handle_upload(). Assuming that you already have the appropriate file form field in your settings page, and that you’re using register_setting() for your options, and therefore already have an options validation callback, simply handle the file form field data using wp_handle_upload(). Here’s an example: <?php // Validate … Read more

How to add code to Header.php in a child theme?

I would hook into the wp_head action. I would place this in a plugin so as to abstract it from your presentation layer. This allows for scalability and changing of themes. This also prevents any analytics collateral damage if a step is missed in migration from one theme to the next. add_action(‘wp_head’, ‘wpse_43672_wp_head’); function wpse_43672_wp_head(){ … Read more

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