I want wpseo_frontend_presenters replace og:image value instead of adding
-
screenshot: https://prntscr.com/uugb0p
Do you have documentation how I can replace the value of og:image instead of adding a new one? as you can see on the screenshot it added new og:image instead of replacing. I’m having a hard time on this, this was so easy on previous version using opengraph image. I also read this https://github.com/Yoast/wordpress-seo/issues/14698 but I dont get how I can replace the value.
This is my code:
use Yoast\WP\SEO\Presenters\Abstract_Indexable_Presenter; class My_Presenter extends Abstract_Indexable_Presenter { public function present() { return '<meta property="og:image" content="//d1id9ov24n1lx4.cloudfront.net/wp-content/uploads/2019/05/21155632/eview_home_hero.jpg" />'; } public function get() { // return $this->presentation->open_graph_image === 'nl_NL' ) ? 'Dutch' : 'Not dutch'; } } function add_my_presenter( $presenters ) { $presenters[] = new My_Presenter(); return $presenters; } add_filter( 'wpseo_frontend_presenters', 'add_my_presenter' );
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘I want wpseo_frontend_presenters replace og:image value instead of adding’ is closed to new replies.