File tree Expand file tree Collapse file tree 2 files changed +52
-3
lines changed Expand file tree Collapse file tree 2 files changed +52
-3
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ public function getImage()
7171 {
7272 $ image = $ this ->getPost ()->getOgImage ();
7373
74+ if (!$ image ) {
75+ $ image = $ this ->getPost ()->getFeaturedImage ();
76+ }
77+
7478 if (!$ image ) {
7579 $ image = $ this ->getPost ()->getFirstImage ();
7680 }
Original file line number Diff line number Diff line change @@ -74,9 +74,7 @@ public function getOptionsByType($type)
7474 'image ' => [
7575 '@type ' => 'ImageObject ' ,
7676 'url ' => $ this ->getImage () ?:
77- ($ logoBlock ? $ logoBlock ->getLogoSrc () : '' ),
78- 'width ' => 720 ,
79- 'height ' => 720 ,
77+ ($ logoBlock ? $ logoBlock ->getLogoSrc () : '' )
8078 ],
8179 'publisher ' => [
8280 '@type ' => 'Organization ' ,
@@ -172,4 +170,51 @@ protected function _toHtml()
172170 . json_encode ($ options )
173171 . '</script> ' ;
174172 }
173+
174+
175+ /**
176+ * Retrieve page title
177+ *
178+ * @return string
179+ */
180+ public function getTitle ()
181+ {
182+ return $ this ->stripTags (
183+ $ this ->getPost ()->getMetaTitle ()
184+ );
185+ }
186+
187+ /**
188+ * Retrieve page short description
189+ *
190+ * @return string
191+ */
192+ public function getDescription ()
193+ {
194+ return $ this ->stripTags (
195+ $ this ->getPost ()->getMetaDescription ()
196+ );
197+ }
198+
199+ /**
200+ * Retrieve page main image
201+ *
202+ * @return string | null
203+ */
204+ public function getImage ()
205+ {
206+ $ image = null ;
207+
208+ if (!$ image ) {
209+ $ image = $ this ->getPost ()->getFeaturedImage ();
210+ }
211+
212+ if (!$ image ) {
213+ $ image = $ this ->getPost ()->getFirstImage ();
214+ }
215+
216+ if ($ image ) {
217+ return $ this ->stripTags ($ image );
218+ }
219+ }
175220}
You can’t perform that action at this time.
0 commit comments