- January 16, 2018 at 6:10 pm #141916
<div class="g-ytsubscribe" data-channelid="UCJA8OyDxRY-wm0ya2gtHOsw" data-layout="full" data-count="hidden"></div>
This is the standard code for a YouTube subscribe button. When this is used in a post (and clearly at the top and within the excerpt length max), it will not display in the homepage excerpt.
I tried the exact code with another theme and it does display in the excerpt so it has to be something specific with Travelify. Can the code be tweaked to show it?January 17, 2018 at 7:26 am #141979
interesting, never seen this code before and from what i see it should not display anything, just an invisible div… Maybe you used this code along with the plugin? because only this code will not do anything
Can i see an example of your page where this code works and shows subscribe button?January 17, 2018 at 7:30 am #141981
ok, i tried to research your question and seems i found it, you are missing one important part in your code, 🙂
it should be something like this:
<script src="https://apis.google.com/js/platform.js"></script> <div class="g-ytsubscribe" data-channel="GoogleDevelopers" data-layout="default" data-count="default"></div>
How i said without plugin code will not work, in this cse we must load one js file, please read more here:
https://developers.google.com/youtube/youtube_subscribe_buttonJanuary 17, 2018 at 3:53 pm #142120
I have that js file also so that’s not the issue. The issue is that all html seems to be stripped from the excerpt. Consequently, the subscribe button does not show.
Can you provide a tweak to the code to allow that div (that contains the subscribe button) to show in the excerpt?
Look at the second post (entitled “ORGANIZED 1-HOUR EVENING ROUTINE ❤️ REALISTIC CLEANING AND MOMMY MOTIVATION”). I want those two Youtube subscribe buttons to show on the homepage excerpt for that post and other future posts.January 18, 2018 at 10:35 am #142324
Sorry but button or any other html coding will not be rendered in excerpts, this is how excerpts work in any WordPress theme, its not supposed to render html tags by default, sorry but this will not possible in excerptsJanuary 18, 2018 at 6:45 pm #142427
Then how/why does the YouTube button display in excerpts using the Responsive theme by Cyberchimps? It’s must be possible. I don’t want to switch the that theme however because I like Travelify for this particular site.January 19, 2018 at 6:18 am #142492
Sorry, i don’t know how other themes is coded by default and naturally, excerpts is not supposed to render anything than short summaries of the post, you can check it here in WordPress Codex:
The fact that they not following COdex and coding standards is not an advantage, my suggestion is to change approach on this problem
You must be logged in to reply to this topic.