New answers tagged

0

Yo don't need to write a plugin for that - what you need already exists. Check this link: https://wordpress.org/plugins/list-categories/ With this plugin you can display categories in any post or page. Of course, maybe you want to write your own plugin, and in that case this link can be helpful. I hope that this will help you to speed up a process.


0

I've modified your code to reflect the wp_list_categories() function reference as suggested by @Usce. This snippet will create an unordered list, remove the "Categories" list title, and add the li class with individual category ID so you can target each link in the list. function catting ($atts, $content = null) { echo '<div id="cats" ...


-1

There is build in wordpress function for that , so you can use wp_list_categories() for that. Please refer here to learn more And after you display them you an do some CSS if you want to display it as buttons. I hope this helps. Kind regards, Usce


0

This may be due to a plugin. Try deactivating all plugins by using the plugin screen select all and use the bulk action to disable all. Afterwhich try installing the WP update again and it should work assuming that this was wotking before and it recently stopped.


0

You may want to check what the Codex recommends for file permissions vs. what you are using. http://codex.wordpress.org/Changing_File_Permissions


0

Now what if you have to add/remove fields from default contact form to change the feel of your comment box? I am eliminating website field from default comment box by playing with ‘fields’ argument:in comments.php <?php $comment_args = array('title_reply' => 'Got Something To Say:', 'fields' => apply_filters('comment_form_default_fields', ...


0

Try adding this to your functions.php - it will wrap the image in the div you want. function filter_image_send_to_editor($html, $id, $caption, $title, $align, $url, $size, $alt) { return '<div class="post-page-image" id="image-'.$id.'">'.$html.'</div>'; } add_filter('image_send_to_editor', 'filter_image_send_to_editor', 10, 8);


0

Diana you must change line of code in this array $args = array( 'exclude'=> $admin_users_list, 'number' => $limit, 'orderby' => 'registered', 'order' => 'desc', 'meta_query' => array( 'relation' => 'AND', 0 => ...


3

From what you are saying you have translated your plugin and now you want to be sure the future update won' be overwritten. So to avoid that happening you can always put your po/mo translation files (if provided) in global languages folder that is located on your server in wp-content/languages/plugins folder. If plugin have language file name for example ...


0

I believe you can hook your new function to comment_template() like this: add_action('comments_template', 'my_function') or function hide_my_comment_template() { return null; } add_action('comments_template', 'hide_my_comment_template')


0

There is no such granular control. The only possible way around it is to use shortcodes that insert content from other "posts" and restrict the access to those posts.


0

Try adding this code to your functions.php file: if(!is_page(array('checkout','cart')) && !WC()->cart->is_empty()) { WC()->cart->empty_cart(); }


0

I've fixed it with my hosting company. They added the domainnames as a CNAME to the main domain which did the trick.


0

New versions of jQuery do not support the href=# selector syntax and require href="#"syntax. Something on your site uses an deprecated syntax. Deactivate plugins/theme until you find which one is it, and contact its author's support.


0

You can change the slug as you want in wordpress. Just go to the post or to the page. Edit the Post or the Page you want to change the slug. On the right side there is a button: Screen Options. Click it and Check slug. Then you'll manually can give what ever slug you want for the post or page.


0

You will have to clarify more about your exact requirement. However as per what's apparent, you simply want to use an iframe inside your content to show any other website. There are various ways to do that manually or through plugins, e.g.: http://wordpress.org/plugins/wp-wrapper/ I hope it helps.


0

You're almost there, but your understanding of how rules work is slightly off. Also I would recommend using the page_rewrite_rules filter: function wpse_224942_page_rewrite_rules( $rules ) { global $wp_rewrite; /* Don't forget to change "my_query_var" in the rewrite rule too */ $new_rules = array( 'bz/([^/]+)/?$' => ...


0

This should get you on track... <iframe src="javascript:void(0);" frameborder="0" style="display:none;width:100%;margin:0;padding:0;" id="fullsizeframe"></iframe> <a href="http://website2.com" onclick="loadfullsize(this.href);">Website 2</a> <script>function loadfullsize(url) { fullsizeframe = ...


0

Alternative solution here: http://pixert.com/blog/cropping-post-featured-thumbnails-from-top-instead-of-center-in-wordpress-with-native-cropping-tool/ Just add this code to functions.php, then use "Regenerate Thumbnails" plugin (https://wordpress.org/plugins/regenerate-thumbnails/): function px_image_resize_dimensions( $payload, $orig_w, $orig_h, $dest_w, ...


0

Ok, in case somebody else needed a solution, I have figured it out. The problem was that Events Calendar Pro stores checked values of multiple checkboxes in one single string delimited by the pipe symbol. Just imploding the sanitized field fixes the problem: if ( isset( $sanitized_values['special_acts'] ) ) { $salva = ...


2

Here's an idea for a starting point, by looking how the word counting is done in the /wp-admin/js/post.js file: /** * Testing word price calculations */ add_action( 'after_wp_tiny_mce', function() { ?><script> ( function( $ ) { $( function() { // Init var $content = $( '#content' ), $count = $( ...


0

Try : //line 6270 $include_arr = explode(',', (string) $q->query_vars[ 'include' ]); $include_arr_adjusted = array(); //line 6272 foreach((array)$include_arr as $include_arr_id) {


0

Found an answer by myself. Hope it will help others with the same issue. Basically, the search-everything plugin responds to an wp_ajax_{#action} type action. One 'problem' is that it only responds for logged-in users, so we must add a nopriv action to functions.php or the like: add_action('wp_ajax_nopriv_search_everything', 'search_everything_callback'); ...


1

This is probably the root cause - https://core.trac.wordpress.org/changeset/36510. Core have moved from saving menus in $_POST to sending them as json encoded and then decode it into $_POST. I am not very familiar with how menus are sent to the server, but you probably either use the wrong hook, use the right hook but too early, or there is a bug in core.


1

The delete_attachment action is fired when wp_delete_attachment() function is called to delete an item in the media library.


0

I am sorry to say but both of Mark's comments are correct. questions concerning third party plugins and themes. As these required detailed knowledge of the workings of those plugins and themes, support is difficult and with thousands of plugins and themes available such knowledge is very specialized. Please consult the appropriate support forum ...


0

Not sure what your question exactly is but yeah - for every apply_filters( 'the_content', '...' ); all hooked filters will be executed. I wouldn't care that much how many times this happens but instead what content is being filtered each time - more the content bigger the performance penalty.


0

I wanted to state, this happened to me a few times in the early WP 3.x days. Am using GoDaddy shared hsoting etc. My solution, i compiled my own HTaccess file(if ur using Apache) against RFI / LFI / SQL injects etc, just very basic ones, disabling the use of base64, bogus image hacks, finger printing and so on. Then you need to check your CHMOD aka ...


0

You need to hook in to the Posts list table using the manage_posts_extra_tablenav filter, but you can show the filter yourself by using the wp_dropdown_categories() function. The only two $args that you are really interested in are depth and taxonomy, but I've included all of the defaults below. Full details of the wp_dropdown_categories() function can be ...


0

Just as Zlatev recommended, I tried to get my data earlier and hook into the Yoast SEO plugin earlier. This worked fine for me. Had to write three new functions to get the desired data from my external data source, but now I have no more problems with setting title, open graph image and more. Lesson learned: Write (wrapper) functions to have your data ...


-3

I personally use and recommend Thrive Leads. It does exactly what you are looking for and unlike most of opt-in plugins, it does not have a monthly fee. Some of the opt-in forms you can create include: Popup Lightbox Content Locking Exit Intent Slide-In Form Opt-In Widget Sticky Ribbon In-Line Forms Scroll Mat Before you spend any money, I recommend you ...


0

There are some plugins, try one of them. Theme My Login is a good example. Link: https://wordpress.org/plugins/theme-my-login/


-1

I found the issue was with the other event plugin I had, for some reason, it made the events page an archive as well and wasn't listing anything. Thank you all for your input. -AJ


1

Custom Post Type registrations in WordPress are not persistent. CPT only exists as long as registration code had been executed in a current page load. If the registration is disabled the data will be in database, but pretty much ignored and invisible to WP core. It is hard to guess what happened in your specific case. Most likely plugin had introduced ...


0

You need to have a <form> element. By not specifying a form action attribute the form posts to the same page you are on which makes this easy to process. Also an id on the textarea is not enough you need to add a name attribute to catch with $_POST for processing. Also adding a nonce field is good practice, and checking permissions to be safe. Try ...


2

WP loads jQuery in no conflict mode so shortcut $ is not available for jQuery to use .You should not use the $ variable for jQuery within WordPress. jQuery(function ($) { //code here }) or (function($){ //code here })(jQuery); There are so many Q&A which refers to the same conflict issue.Check this and this.


0

function your_function() { global $current_user; if($current_user->roles[0] == 'administrator') { add_meta_box(your parameters); // fill in your parameters } } add_action('admin_init','your_function');


0

Download the zip from https://github.com/wp-mirrors/wp-i18n-tools. Extract its content into the wp-includes folder. Command line one-liner from within WP root: $ php wp-includes/makepot.php wp-plugin wp-content/plugins/MYPLUGIN/ wp-content/plugins/MYPLUGIN/MYLANGFOLDER/MYPLUGIN.pot Then you take this resulting .pot file as source for Poedit. Finally ensure ...


2

Most obvious reason could be the fact wpseo_title filter is firing before you have saved your title. Try moving title_storage() call on a earlier stage like. The wp action should be a good candidate.


0

A method would be to edit your template file. If you're using s2member pro, then go to s2member-pro\includes\templates\forms and select the template, based on your payment gateway. For example, if you're using PayPal to process your Credit Card payments, then copy the file named paypal-checkout-form.php into your theme folder. Start editing the ...


1

It doesn't work like as native functionality, a plugin author has to build that themselves, and some have such as Woocommerce and Shortcodes Ultimate. If your plugin doesn't have this functionality and the hooks available (if any) aren't sufficient, you'll need to fork the plugin.


0

The best way to sort it is contacting: plugins@wordpress.org I'm not sure that they'll change the url though. Regarding name of the plugin, simply change it through the php file header and also from the readme.txt file of your plugin.


1

You can change the name of your plugin, you just can't change the url slug of your plugin. Meaning, if you initially added a plugin to the repo and it was called "Posts With Ad Thumbnails" your url would be: https://wordpress.org/plugins/posts-with-ad-thumbnails/ After uploading your plugin, if you decide to change the name just edit your primary plugin ...


0

what about WP REST API V2? I think this is not working on v2! add_filter('json_query_var-meta_query', 'adjustQrry', 10, 1); should it be like this? add_filter('rest_query_vars-meta_query', 'adjustQrry', 10, 1);


0

There is only <title> which is present in your example. <meta title> DOES NOT exist as far as I know :)


0

I'm assuming you're asking how to remove the first action, which the plugin has created? Removing an action is really easy - all you need to do is call remove_action like this: remove_action("admin_init", "backend_plugin_css_scripts_mail_bank"); Then add your replacement action. You need to ensure that you remove the action after it has been added ...


3

No, outside of purely technical aspects of PHP includes (as you correctly pointed out), there is no additional overhead to plugin quantity on general WordPress core load.. The list of active plugins is calculated in advance and stored persistently. The load process just runs over it and performs PHP includes on each. The edge cases where it does take ...


0

If you want the taxonomy under products post type then you must change your code from. register_taxonomy( 'manufactures', 'manufactures', array( 'hierarchical' => true, 'labels' => $labels, 'query_var' => true, 'show_admin_column' => false, 'show_ui' => true ) ); to register_taxonomy( ...


0

So, what you are trying is to add manufactures taxonomy for product post type of Woocommerce Plugin? Change manufactures object type to product and it should work. register_taxonomy( 'manufactures', 'product', array( 'hierarchical' => true, 'labels' => $labels, 'query_var' => true, 'show_admin_column' ...


0

I played around with the plugin files and was able to figure it out myself. For anyone who's wondering, you can use wp_insert_post. You just need to find what variable the generated shortcode is stored in, which can take a little digging through the plugin files. For the plugin I was working with, it went something like this: $my_poll = array( ...



Top 50 recent answers are included