Help With Embed
-
I have used an embed code from artworkarchive.com previously which works just fine as seen on this page:[ redundant link removed ], but I am trying to set up a new page and can not get the code to work now.
Does anyone know why, or what I might be doing wrong? I cloned the paintings page in an attempt to get it to work, but it still doesn’t. Help!
The page I need help with: [log in to see the link]
-
Embed codes added to page content are prone to being corrupted by the editor. The reliable way to add embed code is either make it into a shortcode or add it to a custom page template (based on page.php template). To have a template only apply to one page, name it something like page-new-works.php.
Thanks. I don’t know how to do shortcode.
Why does WordPress have to get more and more impossible for the average person to use? I’ve been using WP since it’s early days but you have to be full fledged programmer anymore to do things which used to be straightforward and simple. Sorry for venting my frustration. 🙁
-
This reply was modified 7 years, 3 months ago by
uncommondepth.
At it’s simplest, you could add this to functions.php of your theme:
add_shortcode( 'artwork', function () { return 'Your embed code goes here'; });Maintain the single quotes in my example which delimit the embed code. If your embed code has any single quotes within, insert a backslash
\in front of each occurrence.In the post where you want the embed to go, type in [artwork]. WP will replace this with the embed code from the above code. Shortcodes can be much more elaborate. If you have a number of different embeds, you could supply some unique identifier like an archive ID so one shortcode can work for any number of different archives.
I understand your frustration over WP not being as simple as you would like. There’s always a trade off between simplicity and flexibility. I personally prefer having flexibility at the cost of simplicity, YMMV. I’d rather have to learn a little bit of programming in order to do what I want than not be able to do it at all. Of course we would prefer to get what we want without any programming, but given the vast range of possibilities, it’s not realistic.
-
This reply was modified 7 years, 3 months ago by
The topic ‘Help With Embed’ is closed to new replies.