Forum Replies Created

Viewing 15 replies - 1 through 15 (of 43 total)
  • bigswp

    (@bigswordpress)

    Hi Roymarco,

    It sounds like you are having the same issue that I did. There are a few simple fixes for this if you look at my forum post here:

    https://wordpress.org/support/topic/woocommerce-issue-22/#post-12028163

    Good Luck

    bigswp

    (@bigswordpress)

    Hi Greg,
    Yes that was the issue thanks so much for your help.

    For those of you having the same issue you have a couple of options…

    1st – Ask your host to update their outdated mod_security rulesets

    2nd – Go to https://github.com/rynaldos/woocommerce-js-cookie-fix and download this file as a zip. Then simply install it on your site as a regular plugin and activate it. There are no settings it works on its own.

    Thanks again Greg.

    bigswp

    (@bigswordpress)

    Hey murphytwin no unfortunately they tell me at Elegant that it is still unresolved. I have disabled Ultimate Member (obviously picking the theme over the plugin) and I just activate it every time they have an update but still no luck.

    Hmm never checked your issue. May just be best to keep it disabled for now. They are just ignoring us anyway.

    bigswp

    (@bigswordpress)

    OMG bcworkz I ran across some code for something else I was working on. For some reason a lightbulb went off in my head and I came up with this…

    function add_image_to_feed( $thumbz){
    if( is_feed() ){
        $def_thmb = get_post_meta( get_the_ID(),'def_thmb',true);
    
        $subPath = tube_sub_dir_path(get_the_ID()); 
    
        $upload_dir = wp_upload_dir();
        $thumb_ur = $upload_dir[baseurl]."/tube-thumbs/".$subPath."";
    
        $thumbz = $thumb_ur."/".get_the_ID()."_".$def_thmb.".jpg";
    
    } else {
        return;
    }
    $thumbz = "<img class=\"img-responsive\" src=\"$thumbz\" >";
    return $thumbz;
    
    }

    So now my RSS feed is getting these images added to them automatically. Brilliant! This is exactly what I needed.

    bigswp

    (@bigswordpress)

    I think the code above is just for doing one image at a time. It asks for a specific file path and Post ID but I have thousands of them.
    I did manage to find a very useful plugin for getting the images easily called “Add from Server” which will do what I need. I can’t see a way to automate it but it is a start.
    I think this is a little bit above my coding skills.
    Thanks again bcworkz I see your name helping people a lot and certainly appreciate it myself.

    bigswp

    (@bigswordpress)

    I did find this code that is supposed t do what you are talking about above but I have no idea how to actually use it ;-)………………..

    When I started using media_sideload_image(), I found it pretty useless as it returned a full html tag, instead of the attachment ID, so I created my own version of it which replicates all the functionality of media_sideload_image() and adds some very useful stuff, like:

    saving the sideloaded file under a completely new filename
    making the submitted image not just an attachment but the post_thumbnail (featured image)
    the ability to specify all sorts of attachment metadata
    Just call the function below instead of media_sideload_image()

    /**
     * Download an image from the specified URL and attach it to a post.
     * Modified version of core function media_sideload_image() in /wp-admin/includes/media.php  (which returns an html img tag instead of attachment ID)
     * Additional functionality: ability override actual filename, and to pass $post_data to override values in wp_insert_attachment (original only allowed $desc)
     *
     * @since 1.4 Somatic Framework
     *
     * @param string $url (required) The URL of the image to download
     * @param int $post_id (required) The post ID the media is to be associated with
     * @param bool $thumb (optional) Whether to make this attachment the Featured Image for the post (post_thumbnail)
     * @param string $filename (optional) Replacement filename for the URL filename (do not include extension)
     * @param array $post_data (optional) Array of key => values for wp_posts table (ex: 'post_title' => 'foobar', 'post_status' => 'draft')
     * @return int|object The ID of the attachment or a WP_Error on failure
     */
    function somatic_attach_external_image( $url = null, $post_id = null, $thumb = null, $filename = null, $post_data = array() ) {
        if ( !$url || !$post_id ) return new WP_Error('missing', "Need a valid URL and post ID...");
        require_once( ABSPATH . 'wp-admin/includes/file.php' );
        // Download file to temp location, returns full server path to temp file, ex; /home/user/public_html/mysite/wp-content/26192277_640.tmp
        $tmp = download_url( $url );
    
        // If error storing temporarily, unlink
        if ( is_wp_error( $tmp ) ) {
            @unlink($file_array['tmp_name']);   // clean up
            $file_array['tmp_name'] = '';
            return $tmp; // output wp_error
        }
    
        preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $url, $matches);    // fix file filename for query strings
        $url_filename = basename($matches[0]);                                                  // extract filename from url for title
        $url_type = wp_check_filetype($url_filename);                                           // determine file type (ext and mime/type)
    
        // override filename if given, reconstruct server path
        if ( !empty( $filename ) ) {
            $filename = sanitize_file_name($filename);
            $tmppath = pathinfo( $tmp );                                                        // extract path parts
            $new = $tmppath['dirname'] . "/". $filename . "." . $tmppath['extension'];          // build new path
            rename($tmp, $new);                                                                 // renames temp file on server
            $tmp = $new;                                                                        // push new filename (in path) to be used in file array later
        }
    
        // assemble file data (should be built like $_FILES since wp_handle_sideload() will be using)
        $file_array['tmp_name'] = $tmp;                                                         // full server path to temp file
    
        if ( !empty( $filename ) ) {
            $file_array['name'] = $filename . "." . $url_type['ext'];                           // user given filename for title, add original URL extension
        } else {
            $file_array['name'] = $url_filename;                                                // just use original URL filename
        }
    
        // set additional wp_posts columns
        if ( empty( $post_data['post_title'] ) ) {
            $post_data['post_title'] = basename($url_filename, "." . $url_type['ext']);         // just use the original filename (no extension)
        }
    
        // make sure gets tied to parent
        if ( empty( $post_data['post_parent'] ) ) {
            $post_data['post_parent'] = $post_id;
        }
    
        // required libraries for media_handle_sideload
        require_once(ABSPATH . 'wp-admin/includes/file.php');
        require_once(ABSPATH . 'wp-admin/includes/media.php');
        require_once(ABSPATH . 'wp-admin/includes/image.php');
    
        // do the validation and storage stuff
        $att_id = media_handle_sideload( $file_array, $post_id, null, $post_data );             // $post_data can override the items saved to wp_posts table, like post_mime_type, guid, post_parent, post_title, post_content, post_status
    
        // If error storing permanently, unlink
        if ( is_wp_error($att_id) ) {
            @unlink($file_array['tmp_name']);   // clean up
            return $att_id; // output wp_error
        }
    
        // set as post thumbnail if desired
        if ($thumb) {
            set_post_thumbnail($post_id, $att_id);
        }
    
        return $att_id;
    }
    bigswp

    (@bigswordpress)

    Hi bcworkz thanks for the help. I have been fooling with this off and on all week and still can’t get it to work. Maybe it is easier to show you the code that the plugin is using for the thumbs. Would I add media_handle_sideload() to THIS function or would I create a new function?

    function tube_thumb($prefix,$title){
    
        $saved_thmb = get_post_meta( get_the_ID(),'saved_thmb',true);
    
        $subPath = tube_sub_dir_path(get_the_ID()); 
    
        $upload_dir = wp_upload_dir();
        $thumb_url = $upload_dir[baseurl]."/tube-thumbs/".$subPath."/";
    
        if($saved_thmb==1){
          $thumb = $thumb_url."/".get_the_ID()."_1.jpg";
        } elseif($saved_thmb>1) {
    
          $def_thmb = get_post_meta( get_the_ID(),'def_thmb',true);
    
          $thumb = $thumb_url."/".get_the_ID()."_".$def_thmb.".jpg";
    
          $rotate_thumbs = "onmouseover=\"thumbStart('$prefix-".get_the_ID()."', $saved_thmb, '$thumb_url');\"
           onmouseout=\"thumbStop('$prefix-".get_the_ID()."', '$thumb_url', '$def_thmb');\"";
        } else {
          return;
        }
    
        $thumb = "<img class=\"img-responsive\" src=\"$thumb\" $rotate_thumbs id=\"$prefix-".get_the_ID()."\" alt=\"".esc_attr($title)."\">";
        return $thumb;
    }
    bigswp

    (@bigswordpress)

    Hi Mika while certainly appreciate any reply at this point because I am 2 days into this. That type of plugin is only going to help me if these images are actually part of the post which at this point they are not. They are named after the post and they link to the post from the main page but they are not actually in the post itself. I need to somehow make these images part of the actual post first and that is the step that I am stuck on.

    bigswp

    (@bigswordpress)

    I should also say that I keep getting suggestions to use plugins like “Get The Image” but I am still one step before that because these images are not yet actually part of the post so I can’t get those plugins to work.
    These images first need to be added to the post in some way before I can do that.

    bigswp

    (@bigswordpress)

    I just used the screen capture from Quick Time on my Mac. Then I do my editing with Wondershare Video Converter

    Now drop this into

    Appearance > Theme Options > Custom CSS

    #main-navigation .sf-menu ul {
    margin: 25px;
    padding: 0px;
    background: #52C0D4 none;
    }

    Just fool around with that I got it looking pretty nice.

    bigswp

    (@bigswordpress)

    Could you please tell me what plugin you are using? I will install it and have a look for you.

    bigswp

    (@bigswordpress)

    Hi heartcenter333 yes WP has the ability for people to sign up on your site so that they will then be allowed to post comments etc. Now if you can get by with giving your users the ability to simply leave comments on your blog then you would not require any type of plugin. For this just go to:

    Settings > Discussion

    and you will notice an array of options there to do what you require.

    I also notice on your main page on the right at the bottom you have the “Meta” activated on your sidebar. This is a widget function that can be edited or removed entirely at:

    Appearance > Widgets > Then you would look for “Meta” on the right side.

    *NOTE: If you set up your blog so that “Anyone can post a comment” without any type of captcha or anything you will likely be bombarded with spam within about 2 weeks. This is why many people would use a plugin with these types of features.

    I hope that helps.

    bigswp

    (@bigswordpress)

    What theme are you using? This is possibly built in. Also do you have a URL we can look at.

    bigswp

    (@bigswordpress)

    That is very simple and it is a built in WordPress feature. I would just create a custom menu. That way you can link to whatever you want and have complete control.

    Look at this Screenshot

    1) Go to: Appearance > Menus
    2) Then use: Links and put the URL to the page you want and Name it whatever you want
    3) Click ‘Add To Menu’
    4) Check off ‘Top Menu’ under ‘Menu Settings’
    5) Click: ‘Save Menu’

    *NOTE: Depending on what theme you are using they would likely have some menu areas that are already coded into it. If you are still having problems please post your URL here and let us know what theme you are using.

    I hope that helps

    bigswp

    (@bigswordpress)

    Hi Kurashiki first thing is your theme has an option to move your logo to the left top of the page which will either be at

    Apperance > Theme Options

    or

    Apperance > Customize

    Now my recommendation to accomplish what you want is to ‘Widgetize’ the right side of your header. This could be done with straight CSS as well but if you go the widget route you can add virtually ANYTHING you want there with ease. This is a little bit complex but can be done. I recommend you follow the instructions that wordpress provides or you unfortunately will have to hire a developer to do this for you

    http://codex.wordpress.org/Widgetizing_Themes

    *NOTE: Something interesting I noticed about your theme is that is comes with an advertisement area already built into it at:

    Appearance > Theme Options > Then scroll down to heading: Advertisement Settings

    Now a guy might be able to get a little creative here and put the code in that you are trying to do because this will render it right in the location that you seek. For example if I can drop a 468×60 or 728×90 banner in there I can put any other code similar to it and it will drop it right beside the Logo as you are requesting.

    I hope this helps

Viewing 15 replies - 1 through 15 (of 43 total)