No Picture
Wordpress

How to get a specific string from a url

  I believe you should be able to use this: global $post; $page_slug = $post->post_name; Where $page_slug is the variable you’re looking for. This has a pretty good explanation of why that works: https://blog.wplauncher.com/get-current-page-slug-wordpress/

No Picture
Uncategorized

Trying to use a variable to set image width

Below code is the code to use $imageWidth = get_option(‘devotional_imageWidth’,’100%’); $content = “<h2>Devotionally Images</h2>”; $content .= ‘<div style=”width:’ . $imageWidth. ‘;”>’; $content .= ‘<img src=”‘ .$show_file. ‘” alt=”Image Title Here”>’; $content .= “devotional by Devotional.ly”; […]

Wordpress

Can WordPress resize BMP files

This is from another thread, with code that lets you limit the filetypes you allow. add_filter(‘wp_handle_upload_prefilter’, ‘yoursite_wp_handle_upload_prefilter’); function yoursite_wp_handle_upload_prefilter($file) { // This bit is for the flash uploader if ($file[‘type’]==’application/octet-stream’ && isset($file[‘tmp_name’])) { $file_size = getimagesize($file[‘tmp_name’]); […]