Tag Info

New answers tagged

1

My problem got solved by commenting the some codes in function.js(theme js folder) that generating "Expand child menu" text.


0

i suggest you to use Litextension migration tool to migrate data from xt:commerce to woocommerce. I had the same plan 2 weeks ago and i took advices from a friend, she used Litextension before and she trusted it. After some simple steps, my migration process run very well and it made me satistify :) you can refer my advice or not but hope you be success! ...


0

Please try replacing print apply_filters( 'taxonomy-images-queried-term-image', '' ); with print apply_filters( 'taxonomy-images-list-the-terms', '' ); For WordPress default post type, I created category.php template and altered your code as below. It is showing category image. You can view the snippet here


0

You can use get_object_taxonomies() as your solution. Returns all the taxonomies for a post type or post object: <?php get_object_taxonomies( $object, $output ); ?> Have you tried anything? something like this? // taxonomy term archives $post_type = get_post_type(); // find out if CPT $taxonomies = get_object_taxonomies($post_type); // Find ...


0

It might be an .htaccess issue. Sometimes I try to flush the rewrite rules from the command line and it doesn't rewrite the .htaccess file until I go into the /wp-admin section, go to 'Settings > Permalinks' and just save it without making any modifications. See if that works.


1

I actually ran into a similar issue yesterday. A theme I was working with was adding 500+ lines of internal styles to the header which absolutely drives me nuts! I ended up finding a clever solution online to work around this which you could use for CSS. The JavaScript side I'll explain toward the bottom. --- :: CSS :: --- There's a few key points in how ...


-1

You've probably came across several different methods for including JavaScript and CSS. There is one primary method recommended in the WordPress Codex. The safe and recommended method of adding JavaScript to a WordPress generated page, and WordPress Theme or Plugin, is by using wp_enqueue_script(). This function includes the script if it hasn't already ...


0

There is three way to use function.php file variable into plugin file. Using global. Make sure you globalize it first. global $my_variable; echo $my_variable; I recommend is using WordPress built-in filter mechanism add_filter. You add the filter in your functions.php file and apply it where needed. In functions.php: add_filter( 'my_variable', ...


0

Basic PHP: functions.php: function my_func() { //doing my staff $my_var = 'data'; //stored data after doing things return $my_var; } In plugin file: //retrieved data from a function declared within a system $got_data = my_func(); function another_func( $got_data ) { //doing staff with $got_data }


0

if ( ! defined( 'WPINC' ) ) die; and if ( ! defined( 'ABSPATH' ) ) exit; add an extra layer of security by preventing any direct access to your plugin file. ABSPATH is a PHP constant defined by WordPress in its core. If your plugin file is accessed from outside of WordPress, the constant ABSPATH or WPINC will not be defined, so it exits the plugin code, ...


0

Write a bash script (or any other shell script) to loop ocer the site and in php just write the detection for a single site and output the value to standard output or a file. Or use http://wp-cli.org/ (which essentially does for you the php code from the paragraph above).


0

You are redirecting the entire domain hence breaking the site, because whole website is getting redirected to a part causing a broken website. So instead of using .htaccess just create an index.html file in your root and do a simple Meta Refresh Or Use this more detailed explanation to do the same using php


1

can I just create one using PHPMYADMIN ? Yes.You can. And its a shortest way to do it.


1

I didn't do this recently but in 2014, in a few WordPress projects that I need additional tables I used Laravel components. In WordPress, if you want to create your own tables by using wpdb and mysql queries. But with the Laravel database classes I managed to do this much more elegantly. A quick rundown how I do this: (note: At the time, I used Laravel 4 ...


2

When I started out with Wordpress I was anti-plugin. I wanted to add everything in my theme's functions.php. When I looked at the bigger picture it began making sense having and leaving some functionalities inside a plugin. There are many write-ups on the subject of what should go into a plugin and what should go into a theme. I, for one, have done one or ...


0

Yes, logged in users get a notification in the back-end if the required plugins aren't installed or activated, see the screenshots: http://tgmpluginactivation.com/screenshots/ No notification will be displayed if all required and recommended plugins are installed and active or if the notification has been dismissed before by the user. For more information ...


0

To add Bulk actions Bulk action are implemented by overwriting the method get_bulk_actions() and returning an associated array: function get_bulk_actions() { $actions = array( 'delete' => 'Delete' ); return $actions; } I have write a blog on how to create WP_List_Table. You can check out ** WP_List_Table - a step by step guide** You can ...


0

You can try this plugin. Anywhere Flash Embed You can use ShortCodes like [swf src="http:/:/www.example.com/my-flash-file.swf" width="600" height="300" params="wpmode=driect"] This should help. For detail instruction, please see plugins page.


0

This is the solution. I had the same problem with my Elegant Themes "Divi", but not other themes. I asked and in support forum the answer is in CSS: .stButton .stFb, .stButton .stTwbutton, .stButton .stMainServices { height: 28px !important; } Also, for the count bubble: .stHBubble { height: 22px !important; }


1

You couldn't have a more perfect solution, since this is precisely what WordPress core itself has to handle. See, in early years WP used just one pass MD5 for passwords. Then they went to better hashing, but obviously it should have kept working with old hashes. Now if you take a look at wp_check_password(), what it is doing (at the moment user attempts to ...


0

The "PressRoom by Newswire" (a free plugin that I authored) creates a press room page on the user's website. It will also helps the user publish and distribute press releases. PressRoom by Newswire allows the user to create "pin style" content blocks for the new press room page. Control over the style of these blocks is provided through an interface that ...


1

It seems to be a WP default setting, as many Webmasters have gotten this warning and never edited the robots.txt. Removing all the disallows is the easiest solution, but I assume you want some or all of those directories blocked. Google is only concerned about the .js and .css files, so you could in theory edit the robots.txt to include: User-Agent: ...


0

It seems like you are creating the folder on main site and trying to read from it on a sub site. This is not the right way to go, remeber that on multisite each site, except for user management, is almost 100% isolated full wordpress that has no easy access to data from other sites. Assuming there should be only one such file in the system, What you ...


0

That plugin makes its init function wcpgsk_init() pluggable, so another way to override it is to define it first in a must-use plugin (as it's too late in your theme's "functions.php"). So you could put your override in "wp-content/mu-plugins/functions.php": function wcpgsk_init() { global $wcpgsk, $wcpgsk_about, $wcpgsk_options, $wcpgsk_session, ...


0

It would be best to use Advanced Custom Fields to handle your custom field implementation. They offer a free and pro version. You create your field groups, and have them display in a custom post type (in this case, it would be the WooCommerce custom post type). You can then call a field while in the loop as simple as <?php the_field('hero_image'); ?> ...


1

If your plugin is registered like this: class Test_Class_Parent { function __construct() { add_action('wp_head',array($this,'test_method')); } function test_method() { echo 'Echoed from the parent'; } } $p = new Test_Class_Parent(); Then you should be able to remove the filter by accessing the global: class Test_Class_Child extends ...


2

This should work: add_action( 'woocommerce_init', 'remove_wcpgsk_email_order_table' ); function remove_wcpgsk_email_order_table() { global $wcpgsk; remove_action( 'woocommerce_email_after_order_table', array( $wcpgsk, 'wcpgsk_email_after_order_table' ) ); }


1

You can use publish_post action hook for notifying post author. function wpcs_author_notification( $post_id ) { $post = get_post( $post_id ); $author = get_userdata( $post->post_author ); $message = "Hi " . $author->display_name . ", Your post, " . $post->post_title . " has just been published at " . get_permalink( $post_id ); ...


1

You need to flush rewrite rules after adding or modifying rewrite rules in WordPress. flush_rewrite_rules() can be used to flush rules. For more info check these links : https://codex.wordpress.org/Rewrite_API/add_rewrite_rule https://codex.wordpress.org/Function_Reference/flush_rewrite_rules


0

With the help of Marcin Pietrzak, I got the answer // "select * from wp_options where option_name = 'wpcf-fields'"; $custom_fields = ( get_post_custom($post_id)); $querystr = "select * from wp_options where option_name = 'wpcf-fields'"; $pageposts = $wpdb->get_results($querystr, OBJECT); if(isset($pageposts) and isset($pageposts[0])): $value = ...


0

Based on a quick look at element inspector on that page, you could also try adding the following CSS to your child theme stylesheet: #post-327 .post-headline, #post-327 .thumblock, #post-327 .ssba { display:none; }


0

1) I see that you have Simple:Press forum plugin. On Dashboard go to Forum -> Options -> General Display Settings -> Forum Page Title and check Remove page title completely box. 2) Add #post-327 img.ssba.ssba-img { display: none !important } to style.css of your theme. Remember that when theme is updated your change will be gone so it is better to create ...


0

I have manage that this way and it seems it's gonna work. I have just use again the scripts that I have used for theme to save some memory on server. /* * Bootstrap Styles and scripts */ wp_register_style( 'bootstrap.min', 'http://domain.cz/wp-content/themes/theme-name/css/bootstrap.min.css' ); wp_enqueue_style('bootstrap.min'); //Bootstrap Scripts ...


0

I have sorted this now. I'm not sure where the original robots.txt content could have come from(??), but I have now changed it on the origin server to: User-agent: * Crawl-delay: 5 Disallow: /feed/ Disallow: /trackback/ Disallow: /wp-admin/ Disallow: /wp-includes/ Disallow: /xmlrpc.php Disallow: /wp-content/ Disallow: ...


2

Your thought is correct. By editing the plugin file you lose updatability. So unregistering and reregistering it in the functions.php would be the correct way to do it.


0

In order to change upload size limit two options have to be changed in php.ini configuration file - upload_max_filesize and post_max_size. These options cannot be changed at runtime so you will need to have access to php.ini in order to modify them. Example: upload_max_filesize = 20M post_max_size = 22M


0

Use this URL format for checkout (if using TortoiseSVN, just right click and do checkout from Explorer): http://plugins.svn.wordpress.org/your-plugin-name You will need to use your username/password for WordPress (the account used to publish the plugin) to do any commits. Command line instructions are available direct from WordPress here: ...


0

Fixed it with: function fwp_rss_regex ($content) { $content = preg_replace('/\<[^\>]*\>/i','',$content); return $content; }


1

Yes, there is a filter for this. The correct filter is wp_mail and is defined in /wp-includes/pluggable.php Line 135 So the code (maybe in your functions.php) should look something like this: function mail_template($args){ ob_start(); require_once (get_template_directory() . '/mail-templates/contacemail.php'); $args['message'] = ...


1

This is an issue with the creation of the nonce. wp_create_nonce( plugin_basename(__FILE__) ) . '/seo_fields.php" /> should probably be wp_create_nonce( plugin_basename(__FILE__) . '/seo_fields.php' ) . '" /> because otherwise !wp_verify_nonce($_POST['clinicalmeta_noncename'], plugin_basename(__FILE__).'/seo_fields.php') would not check for ...


1

wp_mail() falls back to php's mail() function which requires a configured MTA (Message Transfer Agent) on your host. So either you install and configure such a MTA. If you're running a Linux like OS, SSMTP is an easy solution on which you can use any mail-provider to send your system mails via SMTP. Another MTA would be Sendmail, a full featured, yet ...


0

I had a similar issue with the Hueman theme. It is indeed caused by bootstrap styles. Maybe you could try something like this: .nav > li > a:focus { text-decoration: none; background-color: #33363B; }


3

For do this you need to save in the db a value for remember that the alert was already showed. Else you can try to llok on that https://codex.wordpress.org/Function_Reference/register_activation_hook. With this you can execute an hook only on the activate action of the plugin.


0

You can use the $wp_error argument to return an error message. $post_id = wp_update_post( $my_post, true ); if ( is_wp_error( $post_id ) ) { echo $post_id->get_error_message(); } else { echo 'true'; }


0

Use the code functions.php: add_filter('woocommerce_login_redirect', 'wc_login_redirect'); function wc_login_redirect( $redirect_to ) { $redirect_to = 'https://www.example.com/'; return $redirect_to; }


0

I advice you to read these topics: http://code.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-5-tabbed-navigation-for-your-settings-page--wp-24971 Here you can find complete guide making options page with tabbed content. Or you can just copy the html of the tabbed page that you've liked, and use it on your own options page. ...


0

https://codex.wordpress.org/Customizing_the_Registration_Form https://codex.wordpress.org/Function_Reference/wp_update_user Instead of update_user_meta function in user_register hook use wp_update_user Following is the working example: //1. Add a new form element... add_action( 'register_form', 'myplugin_register_form' ); function ...


1

You are almost there. You just need to use wp_mail to send emails containing in your array. Here is how you can achieve that using save_post action hook. /** * To send email on updating your event post * * @param int $post_id The post ID. * @param post $post The post object. * @param bool $update Whether this is an existing post being updated or not. ...


-1

<?php global $wp_roles; ?> <select name="role"> <?php foreach ( $wp_roles->roles as $key=>$value ): ?> <option value="<?php echo $key; ?>"><?php echo $value['name']; ?></option> <?php endforeach; ?> </select>



Top 50 recent answers are included