Tag Info

New answers tagged

0

With a little modification, it helped me a link to PDF files: $args = array( 'post_type' => 'attachment', 'posts_per_page' => -1, 'post_status' => null, 'post_parent' => $post->ID ); $attachments = get_posts( $args ); if ( $attachments ) { foreach ( $attachments as $attachment ) { if( strpos( wp_get_attachment_url( ...


1

When you use the importer it should prompt whether to download any media/attachments it finds in the posts. If you don't say yes, they will not be added to your Media database. To my knowledge, even if you do say yes, Featured Images are not included. It's a very rare instance that I recommend using the built-in importer, and migration from one server to ...


1

You have to convert attachment variable to JSON object using toJSON() . Then you can its property. use attachment = frame.state().get('selection').first().toJSON(); instead of attachment = frame.state().get('selection').first();


0

If you have attachment id then you can call wp_get_attachment_url function to get URL of attachment. <?php wp_get_attachment_url( $id ); ?> wp_get_attachment_url function accept ID. Example usage... for attachment id 12. <?php echo wp_get_attachment_url( 12 ); ?> It will output something like http://example.net/wp-content/uploads/filename


0

Solved it! It was an issue with the Polylang plugin stopping the image from showing, I'm not quite sure why but adding a row to the wp_term_relationships table, where the object_id is the id of the attachment, and the term_taxonomy_id is the id of the language definition in the wp_term_taxonomy table fixed the issue.


0

It is the post_parent field, actually. So, in order to properly answer your question, we would need to know why you think that is not the case. Edit: Based on your comment, I suspect you also need to set the post_status to "inherit". Also, the GUID isn't the URL of the file anymore, not since 2.7. That might still actually work, but it is not reliable. ...


0

Here's a workaround you can put in a plugin or your theme's functions.php file. So far no problems. /* * Workaround Bug 30123 * Affects WP 4.0+, should be fixed in WP 4.1 * https://core.trac.wordpress.org/ticket/30123 */ function bugfix30123__action__admin_init() { if ( isset( $_GET['attachment-filter'] ) && is_string( $_GET['attachment-filter'] ...


0

A combination of answers for you. To remove the "wordpress" from your URL path, I would recommend the following step-by-step on "Using a pre-existing subdirectory". http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install The end result will be your Wordpress content pages at "mydomain.no" instead of ...


2

From /wp-includes/script-loader.php: $scripts->add( 'media-grid', "/wp-includes/js/media-grid$suffix.js", array( 'media-editor' ), false, 1 ); From wp-admin/upload.php: wp_enqueue_script( 'media-grid' ); wp_enqueue_script( 'media' ); wp_localize_script( 'media-grid', '_wpMediaGridSettings', array( 'adminUrl' => parse_url( self_admin_url(), ...


0

The link you want to modify is generated via Javascript in the file /wp-includes/js/media-grid.js (normally the minified version is loaded: /wp-includes/js/media-grid.min.js). At line 314 (in Wordpress 4.0.1) : 313: routes: { 314: 'upload.php?item=:slug': 'showItem', 315: 'upload.php?search=:query': 'search' 316: }, You can try ...


0

You would be changing the wordpress back-end, these changes will be lost when updating. I suggest you press this button instead: http://i.imgur.com/5Ce3MzH.png (Only had a danish installation at hand, but it should look the same) This gives you a detailed view, and all links in this view, leads to the "More details" page. Hope this could help!


0

Assuming that there are limited video in your site. you can replace URL by do following : Expert your site database , Replace URL and import again. This is safe way to replace URL. You can do same thing using sql query also but that can cause problem sometime.



Top 50 recent answers are included