You mention “mfunc” (which is the right directive), but in the actual code, you’ve used “mclude” (which is a different directive). “mclude” is for loading external PHP files, like so:
<!-- mclude -->path/to/file.php<!-- /mclude -->
That’s why you’re getting an “Unable to open file” error. I replied with more details in your other thread :
http://ww.wp.xz.cn/support/topic/dynamic-content-1?replies=3#post-2317713
I removed the php tags and changed to mfunc and now the code looks like this: http://pastebin.com/kL96tswa
and I have aslo tried this code: http://pastebin.com/pXCSg5yt
I get this error code now its driving me crazy now nothing seems to be working
Unable to execute code: $args = array( ‘numberposts’ => 1, ‘orderby’=> ‘rand’, ‘category’ => 34 ); $rand_posts = get_posts( $args ); foreach( $rand_posts as
Well, there are still five <?php...?> tags in your “mfunc” code. Also, removing the <?php...?> tags is not as simple as deleting them. You also need to isolate the HTML tags, by putting them inside echo(...); functions.
For example, original line :
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
will become :
echo('<a href="'); the_permalink(); echo('">'); the_title(); echo('</a></h5>');
Sorry, but I don’t have time to rewrite the entire code for you. You should be able to do it by yourself, by following the example I gave. Once you’re finished, the entire section should look this :
<?php
<!-- mfunc -->
...
<!-- /mfunc -->
?>
If your slideshow is dependent on WP itself it won’t work in this way because W3TC runs before WP is loaded.