Google AMP (Accelerated Mobile Pages) + TagDiv Video Format Posts

Posted in: Newspaper
Post count: 35

Hi,

I’m playing around with Google AMP, and I know you guys aren’t fully supporting this yet, but I was wondering if you could help me get the “td_video_suppport” function working.

Web Example: http://gossiponthis.com/2016/03/09/lil-mama-dragged-twitter-remixing-rihanna-work/ — The youtube video appears at the top because we have formatted this post as a “video” and inserted a youtube link under the “Featured Video” section in the post editor.

AMP Example: http://gossiponthis.com/2016/03/09/lil-mama-dragged-twitter-remixing-rihanna-work/amp/ — Where the image is should be the YouTube video. Or, maybe we could just insert the video embed directly above the post content, and leave the featured image on top.

Regardless, would it be possible for someone to put this together? I imagine it wouldn’t take too much considering the functions are already in the template, correct?

Thanks,

– Dustin

Post count: 9544

Theme does fully support AMP, but any customizations you need have to be made to the actual AMP template provided with the AMP plugin.

So, best bet is to try inserting the video into the template itself either from custom field, or pull the field from the video post type?

Then check validation tool from Google … be careful of some funky stuff with iframes, everything MUST be https if loaded from external location, and there cannot be any inline styles like align tags on paragraphs vs using a class.

Not sure that answered your question, but luckily it’s easy to mod the AMP template. 🙂

==========================

See my tutorial thread on AMP.
https://forum.tagdiv.com/topic/tutorial-getting-started-with-accelerated-mobile-pages-amp/

Theme supports AMP via the plugin made by the same people who make WordPress.

Using YOAST SEO, AMP plugin, and Yoast AMP Glue, our sites are working very very well with AMP.

Post count: 35

Hi Chris,

I’m familiar with how to modify theme files, however I have no idea where to start with this one, ha.

The way the particular plugin I’m using for AMP handles theme files is a little different, so you would probably have to take a look at that. Do you guys do custom work? If so, would it be possible to get a quote from you, privately? What is the best e-mail to reach you at? Or is there a way to send private messages through this forum?

Let me know as soon as you can, thanks!

– Dustin

Post count: 9544

Best bet is to only use the AMP plugin from Automattic as it’s the one being developed for all the WP VIP customers (e.g., TIME) and working with Google more closely than random plugin developers can do. It also adds built in support for those using JetPack, and has a simple template system and ability to change fonts, etc.

Highly recommended, and check the AMP plugin support threads for “edge” solutions as they happen.

Any other plugin you’re using, you’ll need to address the plugin developer for help.

( My company not currently available for work, as we are rebuilding our corporate CMS with a massively hacked version of WordPress right now …. as well as optimizing AMP for our news network sites …. overloaded to put it politely and working on the weekend *again* [sigh] )

Everybody learning to use AMP right now (we started with BETA last November hence why I’m a little ahead of most folks on it!). Seriouusly consider sticking with what might be called the “official” WP AMP plugin. The other stuff, including PageFrog, buggy as hell (see support threads for problems).

“It’s not a job, it’s an adventure.”

Post count: 9544

For tech heads … by massively hacked … we are

– changing wp-content to /assets/
– changing author slug to profile
– removing /category/ slug
– hacked theme name and dependencies to our local branding
– local loading vs CDN of font awesome and jquery for optimzation/opcache in prep for https/2 update to server
– highly compressed html, js, css
– highly optimized wp-config.php file
– if single/ head removal of js/css only intended for home page
– locked down php disabling in core WP folders for security
– complete removal of all comment code
– complete removal of all XML-RPC code
– complete rewrite of local default search to load from paid Google Search Engine (GSE), including from URL search string and default WP search box
– local loading of author/client avatar, captured from gravatar but hosted locally and cached
– custom “more posts from author” function and placement
– custom breadcrumbs since our CMS is in sub-dir, main static site one level up for actual ‘home’
– custom author box to print as plug into after post meta to appear on AMP version of page including link to author/client site and top four socials (rel=nofollow and target blank)
– custom data fields with ACF5 Pro
– custom hook to our YOURLS install to pull in custom shortcode, drop into post meta, for sharing
– custom local functions, CSS, for social sharing buttons that grab YOURLS shortcode
– (and like etcetera)

so, you think you’re confused ? Welcome to my brain right now ! 🙂

Post count: 35

Chris,

Thank you for the info! I’ve disabled the PageFrog plugin and now my headache has been relieved. You are absolutely correct. The default plugin by WordPress/Automattic is much better! I like the fact that you can branch it off of your child theme, which makes using custom functions (which is exactly what I’m trying to do) foolproof. I’m just going to customize my own theme and see how things go from there.

As for your workload, more power to you. You guys do fantastic work around here so I’m sure whatever you’re cooking up will be great. Honestly, seeing that makes my issue seem a lot more manageable, haha.

I am still interested in working with you guys at some point in the future though (maybe later in the year when you’re free?) because I have a lot of custom work I want done to our theme. I’ll reach out at later time regarding that.

Good luck with the CMS rebuild and thanks for the help/info!

– Dustin

Post count: 35

Chris,

Okay, so I’ve customized our AMP theme using the default plugin. Now I’m back to trying to make sure our video posts show up properly.

After going through the theme files, I came across this:

//handle video post format
if (get_post_format($this->post->ID) == 'video') {
//if it's a video post...
$td_post_video = get_post_meta($this->post->ID, 'td_post_video', true);
$td_video_support = new td_video_support();

//render the video if the post has a video in the featured video section of the post
if (!empty($td_post_video['td_video'])) {
return $td_video_support->renderVideo($td_post_video['td_video']);
}

This looks like what I need. It’s basically saying, “If this is a video post, render the video if the post has a video in the featured video section of the post.”

Now, what do I do with it?

Any help is much appreciated, thanks!

Post count: 9544

Hi, note i don’t work here and not part of TagDiv — I started using Newspaper back in late 2013 ? As their thinking was exactly what I was building from scratch, at the time it was very bootstrap oriented, and they were further along. I kind of ‘adopted’ them, hence my lurking in here with advice 🙂

I guess with the featured video code, try putting it into the AMP plugin, exactly the same way it gets dropped into the featured video template?

See what happens ?

Post count: 35

Chris,

I only come here when I have questions, and I see you replying to people a lot, so I just assumed you were a part of the TagDiv crew. My apologies! You must get that a lot because I clicked on your profile and I see that you have “I *do not* work for TagDiv” written in your bio.

I tried playing around with the code before coming here and asking questions, but I didn’t have any luck. I’ll just keep messing around and see what happens.

Post count: 9544

Heh. They gave me a little “red/gold crown” for helping out 😉

I usually pop in here for a little bit while waking up, or while waiting for something to FTP to server, and got sick of watching the “progress window” .. so little bit of a time waster / karma points / or whatever. (Right now I’m uploading bunch of mods to the CMS I’m working on for our corporate site trying to integrate a YOURLS shortcode system into ‘printing’ the code into the social share buttons “on template” …

I disappear for long periods, but since I have multiple sites, and have been doing webdev for 21 years and WordPress for 11-12 years now, I’m usually at the “front” of the line in delving into new stuff like mod_pagespeed, http/2, AMP, or whatever. I guess I was also one of the folks who helped make the “shim” happen for disabling visual composer that Radu did, since one horrible series of VC versions crashed our server. Been around here with them longer than most, I guess.

Anyway – sometimes I have a “highly experienced” comment based on having to deal with a problem for “years” that many here haven’t had to suffer. Of course, some people get mad when I disagree with their comments (whining?) — but not too many of those, thankfully.

So, anyway — gingerbread cookies accepted in my virtual tip jar!

Back to the salt mine!

  • This reply was modified 10 years by simchris.
  • This reply was modified 10 years by simchris.
  • This reply was modified 10 years by simchris.
Post count: 6600

Thanks Chris!


@Dustin
,

Unfortunately as you’ve noted we haven’t made any test on this so we’re not aware of this functionality nor it’s implementations requirements so the best you can do is to follow Chris’s instructions on this and its tutorial: https://forum.tagdiv.com/topic/tutorial-getting-started-with-accelerated-mobile-pages-amp/

Your implementation requires assistance beyond what our support can offer so for this types of customizations you would have to get in touch with a developer or a freelancer that may help you.

Thank you!

Viewing 11 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic.