Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter visualsuplex

    (@visualsuplex)

    Hmm just figured out another way to hack it –

    I went into edit PODS > Advanced > Rewrite > and made it “/”

    So now my taxonomy archive /genre/genre/ = /genre/

    There must be another way around this. Again, apologize for my lack of knowledge of the back end.

    Thread Starter visualsuplex

    (@visualsuplex)

    Let me clarify a little more.

    I’m ultimately trying to have an archive of actual taxonomy terms not posts, so a user can browse those terms first then dive into each taxonomy and see posts.

    From research I understand this is a core issue with WordPress for some folks.

    Thread Starter visualsuplex

    (@visualsuplex)

    Ok so – the taxonomy archives work as such. I can for example go to /genre/landscapes/ and see all landscape posts.

    But What I’m trying to do is create an archive of all the taxonomies within /genre/. The only way I can do that is with the hack I described earlier.

    I guess I could also just make those taxonomies CPTs instead huh?

    Thread Starter visualsuplex

    (@visualsuplex)

    Hi David – just wanted to follow up.

    So using the MLA Insert Fixit – I was able to successfully copy terms from Media to my Custom Post type. Awesome!

    Now – could you point me to where I may be able to hard code all my taxonomies similar to the “Images to Posts” fix you wrote? I’d love to be able to just copy it all in one go vs type in each taxonomy individually in the plugin.

    My next question – what about custom fields? Is there anyway to adapt this fixit, or the Images to Posts to also copying any custom fields I may have?

    For example, I want to include things like Captured Date, Processed Date, Revision Number on each of my “Images” and and corresponding Media. Now of course I could just make custom taxonomies and treat them like everything else, but naturally Dates and information like this better suited for custom fields.

    Thread Starter visualsuplex

    (@visualsuplex)

    Hi David – I’ll look through the MLA Insert Fixit this evening and see if i can make it happen.

    And RE: To be clear, each of the entries you’ve added to the array represent actual taxonomies, and these taxonomies are registered for both Media Library items (post_type “attachments”) and your custom post type?

    Yup!

    I’ve created custom taxonomies for all my image metadata that is shared between my custom posts types, mainly “Images”, “Collections”, and now “Media” – so I can map everything to “Images”. My Theory is I can create a central archive where I can easily pull in any of those CPTs in, and have “relatable” metadata to create sliders/galleries at will in Elementor.

    MY reasoning to have these three taxonomies is follows. (I’m by no means a UX/UI/Coder whatsoever – I’m a photographer and want to build more than just a gallery of images.)

    Each “Image” post/page includes it’s meta data, descriptions ect along with other custom fields (Techniques used, what I learned ect). There is also an archive of “Images” that can be sorted and browsed by the custom taxonomies – among other things. You could in theory call each of these term groups “galleries” if you will, but I wanted something more rich than that.

    So a Collection as a “post type” that includes a selection of “Images”, with copy/stories/ect. attached talking about the collection like a portfolio. By having shared taxonomies between “Images” and “Collections” I can easily combine different queries of those on a page.

    I’m also sharing some custom taxonomies with my “Products” as well, because really.. whats the difference between an “Image” and a a “Product”? They just display different meta (Image info vs product/sale info) to different users. My plan is to combine/share as much as possible as I do basic self fulfillment printing services.

    I might be going about it wrong, it’s just how I figured out how to crack the nut… but trust me when I say… the amount I actually know about the back end of what happening is laughable lol. MLA and your help has been a godsend to say the least haha.

    Thread Starter visualsuplex

    (@visualsuplex)

    Wow David – you are the man! Thank you so much. Works just as I need! So my next question – how would one go about running this plugin/copying taxonomy to an already uploaded media?

    Also Here’s what I added to your code if you’re interested:

      $taxonomy_assignments = array(
                    'attachment_category' => array ( 'name' => 'attachment_category', 'hierarchical' => true ),
                    'attachment_tag' => array ( 'name' => 'attachment_tag', 'hierarchical' => false ),
    				'focal_length' => array ( 'name' => 'focal_length', 'hierarchical' => false ),
    				'camera' => array ( 'name' => 'camera', 'hierarchical' => false ),
    				'iso' => array ( 'name' => 'iso', 'hierarchical' => false ),
    				'lens' => array ( 'name' => 'lens', 'hierarchical' => false ),
    				'shutter_speed' => array ( 'name' => 'shutter_speed', 'hierarchical' => false ),
    				'location' => array ( 'name' => 'location', 'hierarchical' => false ),
    				'region' => array ( 'name' => 'region', 'hierarchical' => false ),
    				'lens' => array ( 'name' => 'lens', 'hierarchical' => false ),
    				'aperture' => array ( 'name' => 'aperture', 'hierarchical' => false )
    Thread Starter visualsuplex

    (@visualsuplex)

    Also David – I’m curious if I could piggy back off the plugin I’m using to auto create a post to somehow get those taxonomies to copy over?

    It’s called “Bulk Images to Posts” and naturally the author doesn’t maintain it. here is the code:

    <?php
    /*
    * Plugin Name: Images to Posts
    * Plugin URI: https://www.adambn.com/images-to-posts
    * Text Domain: images-to-posts
    * Domain Path: /lang
    * Description: Bulk upload images to automatically create posts or pages from them
    * Version: 3.7
    * Author: Adam Barr-Neuwirth (slugiscool99), Alastair (mezzaninegold)
    * Author URI: https://www.adambn.com
    * License: GPLv2 or later
    * License URI: http://www.gnu.org/licenses/gpl-2.0.html
    */
    
    add_action('plugins_loaded', 'bip_load_textdomain');
    function bip_load_textdomain() {
    	load_plugin_textdomain( 'bulk-images-to-posts', false, dirname( plugin_basename(__FILE__) ) . '/lang/' );
    }
    
    require_once( 'includes/bip-category-walker.php' );
    require_once( 'includes/bip-settings.php' );
    
    add_action( 'admin_init', 'bip_admin_init' );
     
       function bip_admin_init() {
           /* Register our stylesheet and javascript. */
           wp_register_style( 'bip-css', plugins_url('css/style.css', __FILE__) );
           wp_register_script( 'bip-js', plugins_url('js/script.js', __FILE__), array( 'jquery' ), '', true );
           wp_register_script( 'dropzone-js', plugins_url('js/dropzone.js', __FILE__), array( 'jquery' ), '', true );     
       }   
       function bip_admin_styles() {
           wp_enqueue_style( 'bip-css' );
           wp_enqueue_script( 'bip-js' );
           wp_enqueue_script( 'dropzone-js' );
    	   wp_enqueue_script( 'jquery-form' );
    	   wp_enqueue_style( 'dashicons' );
       }
    
       function bip_admin_notice(){ ?>
        <div class="notice notice-error error is-dismissible">
            <p><?php _e( 'Bulk Images to Posts','bulk-images-to-posts') ?>: <a href="<?php echo site_url('wp-admin/admin.php?page=bip-settings-page'); ?>"><?php _e('Please update your settings before uploading!', 'bulk-images-to-posts' ); ?></a></p>
        </div>
      
    <?php }
    $bipUpdated = get_option('bip_updated');
    if ( empty($bipUpdated) ) {
    	add_action('admin_notices', 'bip_admin_notice');
    } 
    
    // create plugin settings menu
    add_action('admin_menu', 'bip_create_menu');
    
    // Used in category walker
    function bip_in_array_check($needle, $haystack, $strict = false) {
        foreach ($haystack as $item) {
            if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && bip_in_array_check($needle, $item, $strict))) {
                return true;
            }
        }
    
        return false;
    }
    
    function bip_create_menu() {
    
        // create new top-level menu
        global $bip_admin_page;
        $bip_admin_page = add_menu_page(__('Bulk Images to Posts Uploader','bulk-images-to-posts'), __('Bulk','bulk-images-to-posts'), 'manage_options', 'bulk-images-to-post','bip_upload_page','dashicons-images-alt2');
        // create submenu pages
        add_submenu_page( 'bulk-images-to-post', __('Bulk Images to Post - Upload','bulk-images-to-posts'), __('Uploader','bulk-images-to-posts'), 'manage_options', 'bulk-images-to-post');
    	$bip_submenu_page = add_submenu_page( 'bulk-images-to-post', __('Bulk Images to Post - Settings','bulk-images-to-posts'), __('Settings','bulk-images-to-posts'), 'manage_options', 'bip-settings-page', 'bip_settings_page');
        // call register settings function
        add_action( 'admin_init', 'bip_register_settings' );
        // enqueue scripts
        add_action( 'admin_print_styles-' . $bip_admin_page, 'bip_admin_styles' );
        add_action( 'admin_print_styles-' . $bip_submenu_page, 'bip_admin_styles' );
         
    }
    
    	/*
    	* Register Setting - Needs updating to an array of options. 
    	*/
    function bip_register_settings() {
        register_setting( 'bip-upload-group', 'bip_terms' );
        register_setting( 'bip-settings-group', 'bip_updated' );
        register_setting( 'bip-settings-group', 'bip_post_type' );
        register_setting( 'bip-settings-group', 'bip_image_title' );
        register_setting( 'bip-settings-group', 'bip_post_status' );
        register_setting( 'bip-settings-group', 'bip_taxonomy' );
        register_setting( 'bip-settings-group', 'bip_image_content' );
        register_setting( 'bip-settings-group', 'bip_image_content_size' );
    }
    
    	/*
    	* The main upload page 
    	*/
    function bip_upload_page() { ?>
    
    <div class="grid">
    	<div class="whole unit">
    
    	<h2><?php _e('Bulk Images to Posts - Uploader','bulk-images-to-posts'); ?></h2>
    	<p><?php _e('Please use the settings page to configure your uploads','bulk-images-to-posts'); ?>
    		<a href="<?php echo site_url('wp-admin/admin.php?page=bip-settings-page') ?>">
    			<?php _e('Click here','bulk-images-to-posts'); ?>
    		</a>
    	</p>
    	</div>
    </div>
    <div id="poststuff" class="grid">
            <div class="one-third unit">
    			<form method="post" action="options.php" id="bip-upload-form">
    			    <?php settings_fields( 'bip-upload-group' ); ?>
    			    <?php do_settings_sections( 'bip-upload-group' ); ?>
    			
    					
    
    				    <?php
    $selected_taxs = get_option('bip_taxonomy');
    if (!empty($selected_taxs)) {
    foreach ($selected_taxs as $selected_tax) { ?>
    
    					<?php
    					$selected_cats = get_option('bip_terms');
    				    $walker = new Walker_Bip_Terms( $selected_cats, $selected_tax ); ?>
    				    <div class="postbox">
    					  	<div title="Click to toggle" class="handlediv"><br></div>
    					  	<h3 class="hndle"><span><?php echo $selected_tax ?></span></h3>
    					    <div class="inside">
    						    <div class="buttonbox">
    						    <p class="uncheck"><input type="button" class="check button button-primary" value="Uncheck All" /></p>
    						    <?php submit_button(); ?>
    						    </div>
    						    <div class="categorydiv">
    							    <div class="tabs-panel">
    								    <div class="checkbox-container">
    									    <ul class="categorychecklist ">
    											<?php 
    										    $args = array(
    										    'descendants_and_self'  => 0,
    										    'selected_cats'         => $selected_cats,
    										    'popular_cats'          => false,
    										    'walker'                => $walker,
    										    'taxonomy'              => $selected_tax,
    										    'checked_ontop'         => false ); ?>
    											<?php wp_terms_checklist( 0, $args ); ?>
    									    </ul>
    								    </div>
    							    </div>
    						    </div>
    					    </div>
    				    </div>
    
    				    <?php } } ?>
    
    			</form>
    			<div id="saveResult"></div>
    </div>
    <div class="two-thirds unit">
    	<div class="postbox">
    		<div title="Click to toggle" class="handlediv"><br></div><h3 class="hndle"><span><?php _e('Images','bulk-images-to-posts'); ?></span></h3>
    			<?php include 'includes/bip-dropzone.php';?>
    		</div>
    	</div>
    </div>
    <?php } ?>
    Thread Starter visualsuplex

    (@visualsuplex)

    Thanks for getting back to me.

    So yeah I’m aware of the redundancy of creating an “Image” Post Type. I tried not going that route.

    I’ve been able to theme a “Media” template for single image, and display EXIF ect. I can’t figure out how to create enable the ability to create an archive page of those images though (i.e. treat those attachments like full fledged posts)

    This was my way of hacking through the problem to get my site working. By making a CPT, I was able to make an Archive of Images, and Elementor can see those images like a custom post type.

    Elementor is a WYSIWYG builder that uses widgets on the front end for different plugins/loops. I implement their “Posts” Widget Slider as my main navigation/browsing tool for all of my posts, articles and collections, and want to use it for browsing my individual images as well. I can do this all via GUI and no coding.

    https://docs.elementor.com/article/101-posts

    Check out my page for an Idea on how I use them
    http://www.jordaninglee.com/collections

    So getting back to my issue at hand. I’m not understanding how to implement the gallery shortcode for my need. I’m not trying to display galleries right now. I’m ultimately trying to trying to pull the image as a post into a slider that a user can then click and visit the images “post” page (among other things by treating the image as a post)

    Does my use case make sense? I know it’s not directly related to MLA, but if I can’t figure out how to achieve want I need from the Media attachments and Elementor, then my only solution is the redundant Image CPT and figuring out how to map the Taxonomy from the uploaded Media to the Image CPT.

    Thread Starter visualsuplex

    (@visualsuplex)

    Also – how do I edit my post ? Can’t find a link anywhere

    Thread Starter visualsuplex

    (@visualsuplex)

    So far here is the response from my provider (Siteground)

    Hello Jordan,

    The admin-ajax.php requests are not blocked on our end by default as the WordPress installation heavily relies on this script’s execution.

    I went through the server logs, but I could not find any errors related to jordaninglee.com.

    Thread Starter visualsuplex

    (@visualsuplex)

    Ok – so as per the Network Tab, I’m not seeing any ajax errors. I’m in process of contacting my provider now

    Thread Starter visualsuplex

    (@visualsuplex)

    I’m not sure how to do that. I’m using Firefox; where is the browser network tab?

    In console: here’s what I’m getting when clicking Next Step on Add New Pod.

    Loading failed for the <script> with source “https://stats.wp.com/w.js?ver=202009”. admin.php:2167:1
    Unauthorized request jquery.pods.js:309:67
    Unauthorized request jquery.pods.js:309:67
    Source map error: Error: request failed with status 404
    Resource URL: https://www.jordaninglee.com/wp-content/plugins/pods/ui/js/pods-dfv/pods-dfv.min.js?ver=2.7.16.2
    Source Map URL: pods-dfv.min.js.map

    • This reply was modified 6 years, 2 months ago by visualsuplex.

    Hey David – jumping on this thread here. I’m looking to do a similar job of mapping Media EXIF/Tax to a Custom Post Type (Image); is there any way to modify this plugin to work with any CPT?

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