New answers tagged

1

get_template_directory_uri works in a plugin, in that it returns the active theme directory URI, which is what the template directory is. If you're trying to get the URI for your plugin assets, then you want plugin_dir_url. wp_enqueue_script( 'jquery-repeater-form', plugin_dir_url( __FILE__ ) . 'js/sample.js' );


-2

As per your description ACF will be enough and easiest way to do that. Create custom fields group based on your requirements (per category) then restrict them to specific post category with ACF rules. Hope it will help you!


-1

UltimateMember pages are based on [shortcodes] which will be entered into normal Wordpress pages. By this means the user-profile page, which you are referring to, should be listed under your WordPress pages, the default name generated by Ultimate-Member is "User page". Search this page and edit it, you will see some content like this [ultimatemember ...


2

The rule of thumb in wordpress development is that you should stick with the highest level API you can use. From software development perspective it helps you get a better documentation for your code and reduce the maintenance cost due to the backward compatibility policy. As CPTs have wrapper APIs in core and costume tables do not, it is easy to see that ...


0

I had a similar issue, I was using LibreOffice Calc. When saving as CSV I had to enable "Quote all text cells" for it to work correctly.


0

if(current_user_can( $capability )){ html to display appropriate page } else { header('Location: http://www.registrationorloginpage.com/');} Check the capability of the user and redirect if insufficient privileges.


0

I've found a wordaround that "solves" the problem, but I'm not going to accept this as an answer until I'm not sure it is the only solution (which I suspect it is not). I can tell WP is not including the Ultimate VC Addons (UVCA from now on) CSS because my page does not contain any UVCA shortcode, or, at least, the initial page content doesn't. Shortcodes ...


0

You don't need this global $bp; Try passing an array: $id = 1; $args = array( 'group_id' => $id, 'exclude_admins_mods' => false); if ( bp_group_has_members( $args ) ) :


-2

Please trying closing a </div> before or after your shortcode. This mostly happens when there are any div or elements are not closing properly. Try this </div> [your_short_code_here] Or [your_short_code_here] </div> Hope this will fix yuor issue.


-2

So that was a wonderful idea! I decided to inspect the HTML elements and removed the pieces of code that had a matching pair. I realized they all had a matching pair; however, for some reason, the second column's container was enveloping the third column's container to make it a sub-container if that makes sense? Here's the code snippet I managed to parse ...


2

As far as I can tell, the most right column is being nested within the middle reviews column. I imagine that somewhere in the code (template, sidebar, or widget) there is a conditional statement causing your middle column to not get closed off before the right column starts. To illustrate what is happening, this is how it currently gets rendered: <div ...


0

You can use the theme_page_templates filter to inject your page template. For example: add_filter( 'theme_page_templates', 'filter_inject_page_templates' ); filter_inject_page_templates( $templates ) { $path = 'path/to/the/template/relative/to/the/theme/folder'; $templates[ $path ] = 'Name of the template that displays in dropdown; ...


0

Divi will not be able to support all of the features as you've stated out of the box. With integration of things such as WooCommerce which Divi prefers you use, you'll be able to incorporate features like the quote but probably not on the product comparisons. That being said, DIVI is a very powerful theme, but keep in mind that many themes will need ...


0

This issue probably seems due to permissions of the wp-contents/plugins folder. BTY, check below plugin for remove unwanted plugins call Unwanted Plugins Remover. With this plugin you can remove unwanted plugins on a WordPress core upgrade process. Unwanted plugins are for example Akismet or Hello Dolly. There is the plugin Unwanted Plugins Remover. It will ...


0

Simple solution to this kind of mess that I use, is to have a local FTP server but limit it to the local machine. Your problem is probably due to still some bad permissions, but I really don't like the idea of reducing security just to have nicer update experience. (If you set properly the direct access setting then every security flow in plugins themes ...


1

It's not a tab but you might be able to get started with an upload button. Check out pre-upload-ui and some actions that follow. Namely pre-plupload-upload-ui and post-upload-ui. This will add a couple buttons to the 'Upload Files' tab and to 'Media > Add New'. BUTTONS add_action( 'pre-plupload-upload-ui', 'wpse_20160202_pre_plupload_upload_ui' ); ...


0

Managed to solve my own issue. Simply paste the following into functions.php function custom_wc_ajax_variation_threshold( $qty, $product ) { return 10; } add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 ); Then change the 'return 10;' to however many variations you have. Please note this may slow ...


0

There is no straight forward way to this, as per my knowledge. I have tried to search as well, and did not find any better solution than the below one. Below codes will provide you exactly what you are looking for: class PageTemplater { /** * A Unique Identifier */ protected $plugin_slug; /** * A reference to an instance of ...


2

I will suggest to check the $post object in PHP before adding meta box. And add the meta box if status is draft or auto-draft. Consider this code function update_meta_boxes($current_post_type, $post) { $post_types = apply_filters('lsw_default_post_types', LSW_Organize_Drafts::$post_types); remove_meta_box( 'tagsdiv-lswdrafttype', $post_types, ...


2

This looks like a hack, probably in W3TC. Try disabling all the Plugins one by one, and if it doesn't go away, try switching to the default theme. If that did not work, install WordPress from scratch, and transfer the database to it. If you prefer another debug mode, I suppose your script gets hooked into WordPress in the wp_footer action. To verify that, ...


0

[%%LINKS%%]is very suspicious. It's inside a display:none div, so any links output by a function will be in page source for SEO purposes, but won't display on the site. You probably did get hacked. Try using Adminer « WordPress Plugins to search the database for that string. If you find it, carefully follow ...


0

I have found this small error in my code which stops wp_enqueue_scripts() to work in my theme was I forget to put wp_head in my head section. For another person who may make same mistake are advised to check that they have include wp_head in head part and wp_foot at end of your theme.


0

I found the solution to this was in the $wp_query variable. By getting the global variable for this and overriding the values within it i was able to have full control over what displayed on the page. This allowed me to generate a WP post object that came from a database outside of wordpress, but didnt have to do anything difficult to make it display. Here ...


0

To find projects happening within a range of dates, there are 3 cases you have to account for: A project starts within the range A project ends within the range A project starts before the range and ends after the range You can test for these 3 cases separately with an OR meta query and 1 nested AND: 'meta_query' => array( 'relation' => 'OR', ...


0

$arr['Zumpito_event_full_day'] = isset( $_POST['Zumpito_event_full_day'] ) ? esc_attr( $_POST['Zumpito_event_full_day]) : ''; this should solve your first notice explanation is this in the link given by you


0

First, do not use query_posts! (Why not? That is why!) Second, if your custom fields (CF) are saved in the Ymd-form (you are sure about that, yes?!), everything should be fine, even if you do not define the "type" as "date". Reading through several discussions on SE, etc. it seems to be better just to avoid the "date"-type, if you are not comparing a ...


0

Yes,Brotzka If you replace plugin with newest one the changes that are done in code file are vanish.Just move PMPro to some other place plugin folder refresh your site.


0

PHPStorm and Xdebug is a game changing for me for WordPress development. Highly recommend now. Specially with theirs inline debug tools.


0

You may need to have this line in your code require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); The plugin.php file is not automatically included.


0

This change is untested: if( $file === '' || ! isset( $file ) || ! file_exists( $file ) ) {


0

Have you tried putting the website URL into the website: What Wordpress Theme Is That? In addition to themes, that site displays plugin information and might just give you what you're looking for. The only plugin I've found that is similar to what you're describing is Wp-Appbox, but I'm not sure that it displays all of those details.


0

One option is to use Ajax. I wrote this tutorial on how to use Ajax with WordPress and if you follow those steps, you'll get the general idea. Of course, you'll have to write some HTML to display the radio buttons, and then in your Ajax Callback function, you'll want to change the post status to private or publish depending on the user's response.


1

Any template file must be in the current active theme folder. If they are in a different location, they won't be automatically loaded, instead you need to code and modify the template file location determined by WordPress template system: add_filter( 'template_include', 'envento_type_templates', 99 ); function portfolio_page_template( $template ) { if ...


0

I was missing a crucial line in my AJAX query. Without this option, the call fails, and the pages refreshes. processData: false,


0

This are not url's. They are paths. So disqus-comment-system is the folder of the plugin and disqus.php the "init" php file. Every plugin has more or less the same structure. Install your desired plugin and check it's file structure inside plugin folder of WP. More: https://codex.wordpress.org/Function_Reference/is_plugin_active


0

Here is the answer which I have got // Setting this as a Variable product wp_set_object_terms( $post_id, 'variable', 'product_type' );


3

Try using preventDefault(), it's a jQuery function for preventing default actions called by the browser. First you should call an event handler by firing up your submitter. You can do this as follow: $('#my_upload_form').submit(function (event) { After catching a submit and giving an event with it, you should prevent the default refresh of a browser: ...


1

Try placing $myquery->the_post(); inside your while loop. I think get_the_ID() and get_the_title() depend on that being setup first. Also, wp_reset_query(); should be replaced with wp_reset_postdata();.


1

You didn't specify how many arguments your function accepts when you used add_filter: add_filter( $tag, $function_to_add, $priority, $accepted_args ); Your code only passes a $tag and a $function_to_add, but it doesn't tell WordPress what priority it should be, or how many accepted arguments your function takes. You need to fix that. If you don't provide ...


0

wp_create_user is your friend! It takes a username, password, and email: wp_create_user( $username, $password, $email ); And here's an example: $user_id = username_exists( $user_name ); if ( !$user_id and email_exists($user_email) == false ) { $random_password = wp_generate_password( $length=12, $include_standard_special_chars=false ); $user_id ...


3

@PieterGoosen is cool, and still awake like me and answering like boss. To simplify his code and make it work to this specifically without a bunch of junk on your page: /** * Pieter Goosen writes awesome code */ add_filter( 'register_post_type_args', 'change_capabilities_of_the_custom_css_js_posttype' , 10, 2 ); function ...


4

WordPress 4.4 finally saw the introduction of the register_post_type_args filter which you can use to alter the the arguments used when a custom post type (or build-in type) is registered I cannot code anything concrete now, but the following should get you going add_filter( 'register_post_type_args', function ( $args, $post_type ) { // Only target our ...


1

Use: get_template_directory() and or get_stylesheet_directory() E.g. in zumper/layouts/america.php <?php include get_template_directory() . '/inc/york.php'; //etc... Note: get_template_directory Retrieves the absolute path to the directory of the current theme. get_stylesheet_directory Retrieve stylesheet directory Path for the current ...


1

You most probably ran into problems with escaping code and HTML from each other. Try this (added line breaks just for better readability): <i class=" <?php echo (get_post_meta(get_the_ID(), 'Preis', true) != '') ? 'fa fa-check' : 'fa fa-times'; ?> ">


0

The authentication was done by creating a wp_validate_auth_cookie function and calling it. if ( ! function_exists( 'wp_validate_auth_cookie' ) ) : function wp_validate_auth_cookie( $cookie = '', $scheme = '' ) { if ( XenWord::getVisitor()->getUserId() != 0 ) { return XenWord::getVisitor()->getUserId(); } return false; } endif; ...


0

$gallery = shortcode_atts( array( 'post_gallery' => 'post_gallery', ), $atts ); $image_ids=explode(',',$gallery['post_gallery']); $sigle_img = wp_get_attachment_image_src($image_ids[0], "large"); $img="<div id='tourGallery'><img class='imgthumb' id='' ...


0

That would be too time expensive to make it worth while. You might as well write the plugin using Codeigniter in the first place. The plugin itself, if written correctly, relies on the Wordpress core to implement its functionality. Codeigniter is architecturally different than Wordpress making this task a joy only for someone who likes hitting themselves ...


2

Taxonomy "data" is indeed stored in the database. Taxonomy "definitions" are not. The stuff you put into a call to register_taxonomy is not the data, it's the definition of that data. Stuff you add, like categories or tags, is the data, and yes, it goes in the taxonomy tables like any other taxonomy data. You need to call register_taxonomy every time so ...


0

I have the wp-admin access but I don't have cpanel access. The server is through shared hosting. You can't in any meaningful way put up a "sandbox" given those conditions. You have no way to isolate the code, and you need to isolate the code somehow. As I wrote in a comment, you are putting probably buggy, probably unstable, and potentially insecure ...


2

Change the Stable tag value to your current plugin version 1.0 Make a folder in tags with name 1.0. Copy your plugin files for version 1.0 in that folder with readme.txt and push it on SVN. Do the same whenever you release a new version. Please note: What you keep in your trunk is development version. And defining Stable tag in readme.txt mean current ...



Top 50 recent answers are included