DesignLoud
Forum Replies Created
-
Forum: Hacks
In reply to: Trying to create plugin for results per page – WoocommerceWoocommerce actually has support for this through its actions and filters. Below is what has been updated and I feel like it is close but I cannot figure out how to apply the changes, say I click on 24, how should I go about getting the page to reload and apply the users selection. Does what I have below seem like I am on the right path? Anyone able to chime in on how to apply the users selection to the page?
Updated code:
function woocommerce_sortby_page () { $value = $_POST['value']; add_filter('loop_shop_per_page', create_function('$cols', 'return $value;')); } function woocommerce_catalog_page_ordering() { ?> <form action='<?php echo $_SERVER['PHP_SELF']; ?>' method='post'> <select name="woocommerce-sort-by-columns"> <option value="12">12</option> <option value="16">16</option> <option value="20" selected>20</option> <option value="24">24</option> <option value="28">28</option> </select> </form> <?php } add_action( 'woocommerce_pagination', 'woocommerce_catalog_page_ordering', 20 );
Nevermind, I solved it.. Thanks for the help
Ya I for some reason didnt even think of deregister script, thanks for that. I did catch the name thing just after posting my last one. I still cant seem to get either of them to work though.
here is updated:
function register_woo_radio_button_scripts () { wp_deregister_script('wc-add-to-cart-variation'); wp_dequeue_script('wc-add-to-cart-variation'); wp_register_script( 'wc-add-to-cart-variation', plugins_url( 'woocommerce/assests/js/frontend/add-to-cart-variation.min.js', __FILE__ ), array( 'jquery'), false, true ); wp_enqueue_script('wc-add-to-cart-variation'); } add_action( 'wp_enqueue_script', 'register_woo_radio_button_scripts' );
is that correct?
I am just trying to dequeue their script and enqueue my own but I cannot seem to get it working.. I got the variable.php issue worked out
Here is what I have in my plugin
function register_woo_radio_button_scripts () { wp_dequeue_script('wc-add-to-cart-variation'); // Register the script like this for a theme: wp_register_script( 'wc-add-to-cart-variation', plugins_url( 'woo-radio-buttons/woocommerce/js/add-to-cart-variation.min.js', __FILE__ ), array( 'jquery'), false, true ); wp_enqueue_script('wc-add-to-cart'); } add_action( 'wp_enqueue_script', 'register_woo_radio_button_scripts' );
But that neither dequeues their script or picks up on mine when I view the source.
Forum: Hacks
In reply to: Problem overriding Woocommerce file with pluginWow, I had the folder mixed up.. my bad
man, I was hoping for some luck on this.. I am in the exact same situation.. Tried dequeueing the scripts enqueue mine but cant seem to get it right.. Especially with the add-to-cart-variation.min.js
Anyone know of anything? I am also trying to write a plugin that will over ride the variable.php file and add-to-cart-variation.min.js file in woocommerce..
Forum: Fixing WordPress
In reply to: Enqueuing jquery.min.jsSolved it! Thanks anyways
https://css-tricks.com/snippets/wordpress/include-jquery-in-wordpress-theme/
Forum: Fixing WordPress
In reply to: Enqueuing jquery.min.jsTrust me I know, but I am modifying a theme for someone and thats what version the site resides on. It will save me alot of time if I can stick with that version until they upgrade
Forum: Fixing WordPress
In reply to: CPT Portfolio Pagination Not WorkingCan someone help me with this? I am trying to register my taxonimies for this CPT Portfolio.. I want to add things to my menu to keep them organized like Web Design Portfolio, Graphic Design Portfolio, Etc. However if I add the Web Design Category for the CPT to my menu then it shows me all portfolio pieces instead of just web design, or just graphic design..
I have gotten this far but still cant get it to work
$projtype = strip_tags(get_the_term_list($post->ID, $tax)); $tax = get_taxonomies(); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('taxonomy=' . $projtype . '&post_type=portfolio&posts_per_page=12&paged=' . $paged);
Thanks
Forum: Fixing WordPress
In reply to: Site Malfunction over small error!Download the latest version of WordPress from the WP site, then unzip it and drop the unzipped folder in the root directory of your site via ftp (or where ever your WP files begin) but keep a copy of your current wp-config file in the main folder of your existing site so you can update the new one with your database info. WordPress should do the rest.
Forum: Fixing WordPress
In reply to: Site Malfunction over small error!Yep, that is what I was getting to.. Make sure to keep a copy of your wp-config file though for your database info.
Forum: Fixing WordPress
In reply to: Site Malfunction over small error!Sounds like you just need to get fresh installs of the files you edited in the wp-includes folder. By editing some of those core files is what I think got you jammed up. Do you know what version of WordPress your on and what files you made edits to?
Forum: Fixing WordPress
In reply to: CPT Portfolio Pagination Not WorkingSo I got the pagination to work… kinda
Now it does indeed go to next and previous but wont go past the 2nd page without giving an error 404.. I know there should be things on the third page yet when I try to access it I get the 404 message. Not only that but I have lost my taxonomy. I have the CPT Portfolio broken down into sections like Graphic Design, Web Design, Etc. But when I click on web design I get stuff from the graphic design category, and etc.
Anyone know why this might have happened or a possible fix?
Turns out I was making a mistake when I added the paged parameter so I used keesie’s example above and that is how I am where I am now..
Forum: Fixing WordPress
In reply to: CPT Portfolio Pagination Not WorkingYa I had tried that with no luck… Here is the pastebin of anything and everything that I am using with it.. Maybe someone notices something I’m failing to do.
Forum: Fixing WordPress
In reply to: CPT Portfolio Pagination Not Workingthanks but I tried all of that prior to posting, still no luck..