Page Attachment Permalink Structure based on Menu Order?

I’ve been on a quest for the past couple of days reading up on Rewrite in WordPress but still can’t seem to figure out how to accomplish this. When using pretty links in WordPress, media attached to a page forms a URL like: http://www.domain.com/page_name/attachment_name/ http://www.domain.com/page_name/page_name/attachment_name/ http://www.domain.com/page_name/page_name/…/attachment_name/ What I would like to do is create a … Read more

Prevent Duplicate Attachment When Using wp_insert_post

I am trying to use wp_insert_attachment while using wp_insert_post. It’s successfully creating the post and attachment. It have no problem if I only use the wp_insert_post function, but when I activating the wp_insert_attachemnt, the script create both, duplicate posts and attachments 3 times of the previous created posts and attachments. Here is the code (UPDATED): … Read more

How to make a customized “Create Gallery” tab in the ‘Add Media’ window?

I’m developing a plug-in and wanting to make a customized version of the the “Create Gallery” tab of WP v4.0, but have the resulting output (i.e. what gets inserted into the TinyMCE editor) to be different. The user would click “Add Media”, then “Create Media Gallery” on the left, then pick any files (not just … Read more

Edit default image attachment size

I am building a theme and I use single.php also for attachments. The problem is that WordPress print automatically the images with the_content() in this way: <p class=”attachment”> <a href=”http://www.example.com/wp-content/uploads/2013/09/dsc20040724_152504_532.jpg”> <img src=”http://www.example.com/wp-content/uploads/2013/09/dsc20040724_152504_532-300×225.jpg” class=”attachment-medium size-medium” alt=”” srcset=”http://www.example.com/wp-content/uploads/2013/09/dsc20040724_152504_532-300×225.jpg 300w, http://www.example.com/wp-content/uploads/2013/09/dsc20040724_152504_532.jpg 640w” sizes=”(max-width: 300px) 100vw, 300px” width=”300″ height=”225″> </a> </p> I would like to have images in full … Read more