Add class to all img if they have a certain ACF field
Add class to all img if they have a certain ACF field
Add class to all img if they have a certain ACF field
how show attachment image in comments query
How can I receive uploaded attach file as a Google drive link [closed]
You say you click the Save All Changes button. I think this means you are trying to edit the images via the Upload/Insert images button above the editor? It’s confusing, but this is not the place to edit an individual image that you already inserted into the post. In the Gallery tab you can edit … Read more
If I read correctly it’s not just your custom meta but also your attachments (all images, videos, media, etc) Do you have phpmyadmin? Do an export of the database and do a search for “http://yourlocalhostaddress.com” and replace with “http://yournewwebaddress.com” save and reimport You can also do this with mysql but I’m very new to mysql … Read more
‘post_type’=>’any’ should get you all types except revisions so you should get the attachments but if you don’t try: query_posts( array( ‘posts_per_page’ => -1, ‘ignore_stickies’ => 1, ‘post_type’=> array( ‘post’, ‘page’, ‘attachment’ ), ‘post_status’ => array( null ), ‘post__in’=> $id_list ) ); Update As t31os pointed out that: Attachments don’t have a publish status, which … Read more
If you want to exit the loop after you find an attachment, use break. // Define $programme and pull up $attachments as above $attachment_url=””; foreach ( $attachments as $attachment ) { if ($attachment->post_title == $programme) { $attachment_url = wp_get_attachment_url($attachment->ID); break; } } if ( $attachment_url ) { echo $attachment_url; } else { echo ‘/images/nontvimg.jpg’; }
It seems like what I want is something that WordPress’s internal permalink code isn’t prepared to deal with. After reading this writeup by Otto, I’ve come to understand that having my permalinks start with %category% could create a performance issue down the road and I would have to create a function that further alters the … Read more
The posts query is not recursive by nature. And I don’t think that post_parent accepts multiple IDs, so you will likely need to loop and run this for multiple pages or play with query filters to do this in less requests (if performance becomes an issue).
First add to your for the new input field: <form id=”file-form” enctype=”multipart/form-data” action=”<?php echo $_SERVER[‘REQUEST_URI’]; ?>” method=”POST”> <p id=”async-upload-wrap”> <label for=”async-upload”>upload</label> <input type=”file” id=”async-upload” name=”async-upload”> <input type=”submit” value=”Upload” name=”html-upload”> </p> <p id=”image_title”> <label for=”image_title”>Image Title</label> <input type=”text” id=”image_title” name=”image_title” value=””> </p> <p> <input type=”hidden” name=”post_id” id=”post_id” value=”<?php echo $post_id ?>” /> <?php wp_nonce_field(‘client-file-upload’); ?> <input … Read more