Elron
Forum Replies Created
-
Forum: Hacks
In reply to: Delete Images Attached To Page / PostCharles Clarkson’s code worked perfectly, I just added some protection to it.
function delete_post_media( $post_id ) { if(!isset($post_id)) return; // Will die in case you run a function like this: delete_post_media($post_id); if you will remove this line - ALL ATTACHMENTS WHO HAS A PARENT WILL BE DELETED PERMANENTLY! elseif($post_id == 0) return; // Will die in case you have 0 set. there's no page id called 0 :) elseif(is_array($post_id)) return; // Will die in case you place there an array of pages. else { $attachments = get_posts( array( 'post_type' => 'attachment', 'posts_per_page' => -1, 'post_status' => 'any', 'post_parent' => $post_id ) ); foreach ( $attachments as $attachment ) { if ( false === wp_delete_attachment( $attachment->ID ) ) { // Log failure to delete attachment. } } } } /******* DANGER - WILL REMOVE ALL ATTACHMENTS FROM THIS PARENT ID (666) *******/ // delete_post_media( 666 );
Forum: Plugins
In reply to: [Portfolio Slideshow] Pager typeFair enough!
Thanks.Forum: Plugins
In reply to: [Portfolio Slideshow] Pager typeI just saw these features in the Pro version.
However, I cant afford paying for it for each website I make, even if its a developer version…First of all, I reccomend you reinstall the plugin and try again.
If it still does’nt work then tell us.Thanks Ravan i appreciate that. ??
Take note that the code I wrote is written in Javascript,
so you need to wrap it with jQuery script. It’s not PHP.<script type="text/javascript"> // as the page loads, call these scripts jQuery(document).ready(function($) { // Place the code here... }); </script>
Place this code before </head>
Hey dazfaz,
I recommend just add the script manuelly into the Header.php of your theme. You can use my code (add to to a jquery wrapping script), and all thats left for you to do is use the links of the SWF like this:<a class="fancybox-swf {width:195,height:205}" href="your-swf-file.swf">Click me to open the SWF!</a>
You can set the width and height of your choice.
Good luck!
(Btw, my example link is broken. Here’s the new link to the example)
No, i dont know but here’s an example of how i use it in my client site.
It works fine on all the browsers. (even ie7+)Your plugin is great!
Many thanks.