Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter jadamson

    (@jadamson)

    @sarkparanjothi I understand that its basic browser behavior. BUT WC saves the values so I would expect this plugin to do the same, otherwise the user has 2 refill in any of the custom field values. O-well just my opinion.

    Thread Starter jadamson

    (@jadamson)

    Since upgrading to 4.4.2 I seem to be having close to the same issue, I am getting an 404 on /wp-includes/js/tinymce/plugins/lists/plugin.min.js which is making the visual editor not work.

    Did u ever find a solution?

    Thread Starter jadamson

    (@jadamson)

    I can get the next and previous links to work on single-portfolio.php, how would I add in the numbers though? <next 123…456 prev> is what I need to do

    Thread Starter jadamson

    (@jadamson)

    figured it out, I had old code in my function.php file

    update_option('siteurl','http://www.guffeysautomotive.com');
    update_option('home','http://www.guffeysautomotive.com');
    Thread Starter jadamson

    (@jadamson)

    Thank you very much Keesiemeijer! Here is the final working version in-case anyone else finds this page. It returns, all thumbnails from a specific post type, links them to the parent page and adds alt text.

    $post_type = 'portfolio';
    global $wpdb;
    $where = get_posts_by_author_sql( $post_type );
    $query = "SELECT * FROM $wpdb->posts p where p.post_type = 'attachment' AND (p.post_mime_type LIKE 'image/%')  AND (p.post_status = 'inherit') AND p.post_parent IN (SELECT $wpdb->posts.ID FROM $wpdb->posts  {$where} ) ORDER BY p.post_date DESC";
    $results =  $wpdb->get_results( $query );
    
    if ( $results ) {
      foreach ( (array) $results as $image ) {
      	$url = get_attachment_link($image->post_parent);
      	$thumb = wp_get_attachment_thumb_url( $image->ID );
      	$alt = get_post_meta($image->ID, '_wp_attachment_image_alt', true);
      	print '<li><a href="' . $url . '"><img src="' . $thumb . '" alt="' . $alt . '" /></a></li>';
      }
    }

    Thanks again for your help!

    Thread Starter jadamson

    (@jadamson)

    Thank you. I am attempting the custom query one, its sooooo close. The problem is, I don’t want the image linked to the single attachment page, I need it to link to the page it was uploaded to. Here is what I have so far…

    $post_type = 'portfolio';
    global $wpdb;
    $where = get_posts_by_author_sql( $post_type );
    $query = "SELECT * FROM $wpdb->posts p where p.post_type = 'attachment' AND (p.post_mime_type LIKE 'image/%')  AND (p.post_status = 'inherit') AND p.post_parent IN (SELECT $wpdb->posts.ID FROM $wpdb->posts  {$where} ) ORDER BY p.post_date DESC";
    $results =  $wpdb->get_results( $query );
    
    if ( $results ) {
      foreach ( (array) $results as $image ) {
      	print wp_get_attachment_link( $image->ID,thumbnail,true );
      }
    }

    wp_get_attachment_link is giving me a link in this format, mysite/myCustomPostType/PageUploadedTo/AttachmentPage. Is there a way to just make it link to mysite/myCustomPostType/PageUploadedTo ?

Viewing 7 replies - 1 through 7 (of 7 total)