Nexxoz
Forum Replies Created
Viewing 6 replies - 1 through 6 (of 6 total)
-
Forum: Plugins
In reply to: [WP-PostRatings] Custom StarsThere should be an option so we can add icons from lets say fontawesome
Found the problem! I have a custom loop that dose not filter out shortcodes and with this simple line it started working
<?= apply_filters('the_content',$array[0]->content); ?>
Sorry, i see that i was unclear in my earlier message.
We are not using a custom plugin, we are using WP included tinymce (wp_editor). It only prints the shortcode.
Do you have any ideas why it might just print out the shortcode and not show the gallery?
Forum: Hacks
In reply to: [HELP] Upload to MEDIA libraryCode above works
Forum: Hacks
In reply to: [HELP] Upload to MEDIA libraryNever mind, fixed the code.
if(isset($_POST['ch-upload'])){ $text; if ( ! function_exists( 'wp_handle_upload' ) ) require_once( ABSPATH . 'wp-admin/includes/file.php' ); $uploadedfile = $_FILES['myfile']; $upload_overrides = array( 'test_form' => false ); $movefile = wp_handle_upload( $uploadedfile, $upload_overrides ); if ( $movefile ) { $wp_filetype = $movefile['type']; $filename = $movefile['file']; $wp_upload_dir = wp_upload_dir(); $attachment = array( 'post_mime_type' => $wp_filetype, 'guid' => $wp_upload_dir['url'] . '/' . basename( $filename ), 'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)), 'post_content' => '', 'post_status' => 'inherit' ); // $attach_id = wp_insert_attachment( $attachment, $filename); // wp_update_attachment_metadata($attach_id, $filename); $attach_id = wp_insert_attachment( $attachment, $filename ); require_once(ABSPATH . 'wp-admin/includes/image.php'); require_once(ABSPATH . 'wp-admin/includes/media.php'); $attach_data = wp_generate_attachment_metadata( $attach_id, $filename ); wp_update_attachment_metadata( $attach_id, $attach_data ); image_resize($filename, 200, 200, true, '250x250'); $text = 'Image uploaded! Waiting to be accepted by admins'; } } if(empty($text)){ echo '<form role="form" method="post" enctype="multipart/form-data">'; echo ' <div class="form-group">'; echo ' <label for="exampleInputFile">V?lj fil</label>'; echo ' <input type="file" name="myfile">'; echo ' <p class="help-block">Minst 250x250px</p>'; echo ' </div>'; echo ' <button type="submit" name="ch-upload" class="btn btn-default">Ladda upp</button>'; echo '</form>'; }else{ echo $text; }
Forum: Themes and Templates
In reply to: Pagination not working on news page-bump
Viewing 6 replies - 1 through 6 (of 6 total)