Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

chuffORG2000 on "embed HTML5 interactive animation in Category"

$
0
0

Hello, I've done a ton of searching on this and no luck, plus I'm much more of a graphic designer than web designer, so please forgive my noob-ish understanding of code. I can get it to work in Pages and Posts (see here: http://technologyvcc.com/?p=47) using the below code, but in my "Room Signs" Category it just displays the code (see here: http://technologyvcc.com/?cat=4), which I entered into the categories Description field. I'm doing all this in a child theme, and have created a category.php for it with this code:

<?php

	get_header();

	if(have_posts()) :

?>

		<div id="post">

			<div class=" post-list-content">

				<h1><?php echo single_cat_title('', false); ?></h1>

			</div>

		</div>
<?php if (is_category('Room Signs')) : ?>
<[iframe src="http://technologyvcc.com/GOOGLE_DESIGNER_TEST/GOOGLE-DESIGNER-TEST.html" width="1200" height="600"] shortcode>
<p>This is the text to describe Room Signs</p>
<?php elseif (is_category('Kiosks')) : ?>
<p>This is the text to describe Kiosks</p>
<?php else : ?>
<p>This is some generic text to describe all other category pages,
I could be left blank</p>
<?php endif; ?>
<?php

		get_template_part('content', 'postlist');

	else :

		get_template_part('content', 'none');

	endif;

	get_footer();

?>

This is the code that works on Posts and Pages:

[iframe src="http://technologyvcc.com/GOOGLE_DESIGNER_TEST/GOOGLE-DESIGNER-TEST.html" width="1200" height="600"] shortcode

I've also added the below to a new functions.php in my child theme:

<?php

add_shortcode('iframe', 'ag_iframe');
function add_iframe($initArray) {
$initArray['extended_valid_elements'] = "iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]";
return $initArray;
}
add_filter('tiny_mce_before_init', 'add_iframe');

Any help is greatly appreciated, thanks!


Viewing all articles
Browse latest Browse all 8245

Trending Articles