New answers tagged

1

I tried another solution and that did the trick. I found in the WooCommerce docs this little snippet: // Display 24 products per page. Goes in functions.php add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );. It is overriding the settings in the customizer. I only have to change the number '24' to my liking.


0

You can import and export WooCommerce Simple product with images from URL by using this WordPress Free Plugin.


0

Figured it out, I was overwriting it here $guide_info = array($guide_name, $guide_description); $options = $guide_info; and it needed to be $guide_info = array($guide_name, $guide_description); $options = array($guide_id, $guide_info);


0

I don't know what hook Woocommerce uses to add that customizer code, but in your functions.php you'll have to hook your own function on a later time, like this (the last number is the lower priority): add_action ('the_name_of_that_hook','wpse_280836_mycontrol', 99) Now in the function you are hooking, you must first remove the existing control and the add ...


5

Tell your boss that Visual Composer is the cancer of WordPress. Tell your boss that you've separated content concerns from visual ones, and that you're not tied into an abhorrent shortcode nightmare should you ever wish to move away from VC and/or change the layout. To elaborate, "VC vs ACF" isn't really a question - they are two completely different ...


0

I solved this by deleting the plugin. But I kept getting error messages. After I deleted my page cache, everything works again!


0

You can use TGM Plugin Activation library to let the user know about required and recommended plguins that your theme depends on. Automatically installing plugins is not a better choice instead let the users know that X plugin should be installed and activated in order for the theme to work properly. If your theme requires a plugin without which it gives ...


1

This is a partial answer, because as I mentioned in my comment I'm not sure why your code is requiring two 'really bad words' at the moment. It's also an untested attempt. I'll deal with your first question: how to send a user back to the posts page and display a suitable error message, rather than an error about editing posts in the trash. A way to do ...


0

I solved the problem by installing php-ssh2, which removes libssh2-php on the install. $ sudo apt-get install php-ssh2 I also had to change permissions on the wp-content folder to 775, but it worked leaving the wp-content/plugins at 755. $ chmod 775 wp-content


0

this works for me : http://www.deluxeblogtips.com/2010/05/add-custom-column.html In my case I used this code : add_filter('manage_edit-projet_columns', 'my_columns'); function my_columns($columns) { $columns['categorie'] = 'Catégorie'; return $columns; } add_action('manage_posts_custom_column', 'my_show_columns'); function my_show_columns($name) { ...


0

Change the_field() to get_field() the_field() = echo get_field()


1

When you are concatenating string you shouldn't use ;after the method. Also you should close que quotes, call the method, and open again. Try the code below: $listItem .= '<div id="agenda-block-image-responsive" style="' .get_field('speaker-img' ) . '">';


-2

Now, without your code is difficult to answer; however, I will give you some code you can adapt to your own classes to make that effect. First you need to tell your element how long the transition should take: -webkit-transition: all 0.5s ease-in-out; -moz-transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out; Then you can make your ...


1

The following is not a solution to just insert into a regular WooCommerce catalog page. However, this would easily serve as a basis for someone trying to achieve that. Background: I'm building an Angular/JS app to load on the archive-product page, which will handle everything including the cart until a user is ready to proceed to checkout... at which point ...


0

You can indeed add a filter to get_next_posts_link, but it has a different name, namely next_posts_link_attributes Complete code would look like this: add_filter('next_posts_link_attributes', 'wpse_230552'); function wpse_230552() { return 'class="iamclass"'; }


0

It looks like the filter's name is next_posts_link_attributes but not get_next_posts_link as that the name of the function. So try instead: add_filter( 'next_posts_link_attributes', 'wpse_next_posts_link_attributes' ); where wpse_next_posts_link_attributes() is your filter callback. Example (untested): function wpse_next_posts_link_attributes( $...


4

No, deactivated_plugin won't fire during a plugin's uninstallation process. But there are indeed two hooks that fire when a plugin is uninstalled: pre_uninstall_plugin, which is called right before a plugin is uninstalled. It acts globally, targeting any plugin. uninstall_{$file}, which fires after a specific plugin is uninstalled. Its scope it's limited ...


0

It's a bad idea because woocommerce has about 20 translations. In that case you have to translate the modified text domains, or if they don't the 50% of woocommerce will be english, but I want spanish.


1

After a little bit of trial and error, I finally got my code to work. This will redirect http://example.com/wp-admin/plugins to http://example.com/wp-admin/admin.php?page=pretty-plugins.php if the current user doesn't have access to update core. add_action( 'admin_menu', 'block_direct_plugin_page_access' ); function block_direct_plugin_page_access() { ...


0

The most obvious approach to this would be to first create a special user role for your students. Then for users with this role you can expand the profile with extra fields. Here you can store for every user which courses they follow. Next you define a custom post type that allows you to store the video labelled with the courses for which it is meant. ...


0

I don't know if you are answered...but what i have encountered especially when i was working on linux and i just thought maybe other users, especially who are working on linux might find this useful. I was facing the same problem...but i had to use the SSH2 option. How to install SSH2 apt-get install openssh-server libssh2-php After that, i had to ...


0

Change the following and save the file. Change the line that says: require( dirname( FILE ) . '/wp-blog-header.php' ); to the following, using your directory name for the WordPress core files: require( dirname( FILE ) . '/Folder Name/wp-blog-header.php' ); Login to the new location. It might now be http://example.com/wordpress/wp-admin/ If you have set ...


2

<?php /* Plugin Name: Custom output Description: A module to test the custom output. To test: http://your_wordpress_site.com/customop_uri_path Version: 1.0 Author: Danilo Silva Author URI: http://danilocgsilva.me */ // Write a new permalink entry on code activation register_activation_hook( __FILE__, 'customop_activation' ); function customop_activation()...


0

I am not completely sure what you mean, but it looks like you are looking for is_user_logged_in. You can use this test in your templates to test if a user is logged in and display information accordingly. In this fassion: if (is_user_logged_in()) { ... show some content ... } else { echo "Please, login first"; wp_login_form ($args); ...


4

Your analogy here is partially correct, but incomplete: I understand that when do_action is called wp looks for all registered listeners and invokes them according set priority. You need to consider what happens when you call add_action. WordPress never searches for the add_action statements, it has those in a list. When you call add_action, it ...


0

it is better you write like this: class My_Activator { public static function jal_install() { global $wpdb; global $jal_db_version; $table_name = $wpdb->prefix . 'fnotice'; $charset_collate = $wpdb->get_charset_collate(); $sql = "CREATE TABLE $table_name ( id INT NOT NULL ...


0

All your actions belong in your functions.php, assuming that you are building a theme. It is here that you add actions to certain events in your templates. Now, once it has read functions.php WP has a list of actions it is supposed to undertake at certain points in your theme templates. There are several predefined action hooks, such as wp_head() and ...


0

I had the same problem and I have found a solution : Call the same page with a parameter and include the content depending on the paramter : if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define(PLUG_NAME, "my_admin"); //hook to add an item in the menu admin add_action('admin_menu', 'my_admin_setup_menu'); function ...


0

You need an action called manage_$post_type_posts_custom_column. This will allow you to add columns to your custom posts page. To be more precise, you need a filter to generate the column and an action to fill it with content. In your case something like this (untested): add_filter( 'manage_chimpmunks_posts_columns', 'set_custom_size_column' ); add_action( '...


0

The plugin that you need is "Admin Language Per User". Download the language pack of your choice from http://wpcentral.io/internationalization/ Extract the content into wp-content/languages (create the languages folder if it does not exist yet) Install and activate this plugin: https://wordpress.org/plugins/admin-language-per-user/ (Compatible up to: 4.5.2)...


3

do_action( 'deactivate_' . $plugin, $network_deactivating ); Fires as a specific plugin is being deactivated. do_action( 'deactivated_plugin', $plugin, $network_deactivating ); Fires after a plugin is deactivated. The above hooks don't fire when silent mode is activated (eg: during an update). Refer: deactivated_plugin


0

Ubuntu Users Just add define('FS_METHOD','direct'); to wp-config.php and it will work on localhost. Just make sure you don't add it to production version. See: codex.wordpress.org/Editing_wp-config.php


0

Most of your question is off topic, I guess, because it involves a question about Google's APIs. You would need three things: Create the possibility to login to your site with a Google account. There are plugins that make this possible, like this one. Import the list of group members from Google. There probably is an API for this, but that is out of the ...


1

There are scripts available which can do the job for you. As per my understanding, you will have to host your plugin updates on a remote location so that the update checker can access that and do the necessary job. You can take a look at this script which seems to be very useful as per the comments. You can also find examples on that page which you can ...


0

For finding post with specific category, Here is solution. Use https://wordpress.org/plugins/json-api/ plugin And fire http://localhost:8080/wordpress/wp-json/wp/v2/posts?filter[category_name]=android Change category name instead of android. Thanks.


2

In the template part used in the loop on your home page, something like this should get you started. Someplace after the_content(); or the_excerpt(), depending on what you're using. <?php if ( is_home() ) { ?> <a class="button" href="<?php echo esc_url( get_permalink() );?>#comments"> Comment Link Text </a> } ?> ...


1

Off the top of my head - put this in your functions.php: add_filter( 'infinite_transporter_in_same_cat', '__return_false' );


0

I used Pods along with Flexslider http://flexslider.woothemes.com/ Flexslider markup is an HTML list. A Pods loop generates the list of images (in my case). Add the Flexslider JS in the appropriate place for the animation and you're good to go. Most plugins don't provide a way to programmatically generate the list, but this way you can. My implementation ...


0

There are two possible approaches you can take. One would be to hook into whenever a Page is published and write code to update the menu accordingly, effectively making something similar to the built-in "add top level pages" functionality. You'd need to think carefully about what you would like to happen when the Page parent is changed and so on. So ...


-1

The solution I read nowhere on the internet: tb_position is the thickbox function that do strange things with the window size. You can easily and simply overide it by the time thickbox call it. old_tb_position = tb_position; tb_position = function(){ $("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px', ...


0

Add below code in function.php file of your current theme. add_action( 'after_setup_theme', 'setup_woocommerce_support' ); function setup_woocommerce_support() { add_theme_support('woocommerce'); }


-1

Add this code in your child function.php add_filter ( 'wc_order_is_editable', 'majemedia_add_order_statuses_to_editable' ); function majemedia_add_order_statuses_to_editable () { return TRUE; } now you can edit orders... try editing orders and let know if any issues


2

There seems to be two separate question here: Should one do this? Not under most circumstances. Modifying third party extensions de-facto forks it with all implications of future maintenance and/or merging upstream (from original) changes. Without long term commitment it's just not practical and promptly falls apart, like in the cases you witnessed. ...


1

If the original plugin has some form of GPL license, it is okay to manipulate it as long as you honour the license. So, there is nothing legally wrong with editing a plugin, a theme or even WP core. However, if you do this, you take over responsibility for updates from the original builders. In a way, you have become the author of a new plugin. If you don't ...


0

This is old but just in case people are still looking WooThemes as a simple solution: if ( is_product() && has_term( 'your_category', 'product_cat' ) ) { //do code } *Change 'your_category' to whatever you are using. Here is the link to the documentation: https://docs.woothemes.com/document/remov-product-content-based-on-category/


1

Including a PHP file requires to provide its exact file path, not the URL. Try this instead: include_once( WP_PLUGIN_DIR . '/plugin-name/classes/event.php' ); Hope it helps.


0

I had the same problem, this link explains how to change your filesize upload limit https://www.digitalocean.com/community/tutorials/how-to-change-your-php-settings-on-ubuntu-14-04 Basically find your php.ini file, and change these two below to 30M post_max_size = 8M upload_max_filesize = 2M


0

The right function to use is: plugin_dir_path(); Example: include_once plugin_dir_path( __FILE__ ).'plugin-functions.php';


-1

If you're feeling lazy you could also do require_once( ABSPATH . PLUGINDIR .'/pluginname/pluginfunctions.php' ); This helps if you like to keep your code lines short but isn't much different from pbd's answer.


2

Scripts must be inserted using wp_enqueue_script. This function allows you to define dependencies, so you can be sure they load after jquery. Like this: wp_enqueue_script('your-script-name', 'full-path-to-your-script', array('jquery')); Even better, register your script first. Anyway, look in the plugin code where it enqueues user scripts and make sure it ...



Top 50 recent answers are included