• Здравствуйте, подскажите как можно узнать значение этого заголовка?
    <meta property=”og:type” content=”website”/>
    Я хочу совсем убрать вывод Open Graph, с целью полностью кастомизировать. У меня на сайте есть записи в которых содержится информация о фильмах.
    meta property=”og:type” content=”video.movie”
    Так вот хочу чтобы во всех остальных страничках, там где не фильм, проставлялось значение по умолчанию.
    Или может если так конечно возможно то выключить вывод Вашим модулем Open Graph только на страничках с фильмом, а во всех остальных чтобы он выводил как прежде.

    Hello, tell me how you can learn the meaning of this title?
    <meta property = “og: type” content = “website” />
    I want to completely remove the output of Open Graph, in order to completely customize. I have records on the site that contain information about films.
    meta property = “og: type” content = “video.movie”
    So I want the rest of the pages, where there is no film, put the default value.
    Or maybe if so of course it is possible to turn off output by your Open Graph module only on pages with a film, and in all the others so that it displays as before.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi, wladi,

    Video markup is planned for a future release: https://github.com/sybrew/the-seo-framework/issues/95

    In the meantime, you can conditionally turn the Open Graph functionality on and off, but this requires using many filters. I can’t make this easier before we support PHP 5.5+ only.

    Instead, I recommend changing and adding to the Open Graph values.

    First, you’ll want to conditionally change the og:type:

    add_filter( 'the_seo_framework_ogtype_output', function( $type, $post_id ) {
    
    	if ( /* condition */ ) {
    		$video_url = ''; /* test video url... */
    		if ( $video_url ) {
    			$type = 'video.other';
    		}
    	}
    	
    	return $type;
    }, 10, 2 );

    Then, you’ll want to conditionally add the video URL. Don’t overwrite $after, add to it instead:

    add_filter( 'the_seo_framework_pro', function( $after ) {
    	
    	if ( /* same condition */ ) {
    		$video_url = ''; /* video url... */
    		if ( $video_url ) {
    			$after .= sprintf( 
    				'<meta property="og:video" content="%s" />',
    				esc_url( $video_url )
    			) . PHP_EOL;
    		}
    	}
    	
    	return $after;
    }, 10, 1 );

    I hope this helps ??

    Thread Starter wladi

    (@wladi)

    Спасибо за оперативный ответ, а на сколько скоро должна появиться эта версия с поодержкой значения video? На эту задачу сроки в целом у меня не горят, поэтому хочу оценить может просто Вас подождать?

    Thanks for the prompt response, and how soon should this version appear with the support of the video value? On this task, the timing as a whole, I do not burn, so I want to evaluate, can you just wait?

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi wladi,

    I don’t think idioms translate well ?? But I got the gist of what you’re trying to convey.

    You can test the code with Facebook’s Sharing Debugger: https://developers.facebook.com/tools/debug/sharing/

    There’s no ETA for adding the video markup in our plugin yet. We have big tasks ahead to complete first. One of these is Gutenberg integration.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘meta property=”og:type” content=”website”’ is closed to new replies.