wordpress-plugin

Add multiple dates to custom post type in Wordpress

梦想的初衷 提交于 2019-12-22 12:27:13
问题 I am building a Wordpress site with pages, posts and events (with multiple dates you can sign in). I am new to Wordpress so I was looking for ideal solution for this events. I believe the best solution is to create custom post type called "Event" and then handle it separately. I am not sure however how to add multiple dates to each event. I have been reading about custom taxonomies and post metadata but every example I went through was like creating a custom category, tag or adding a single

Wordpress filter not being added

醉酒当歌 提交于 2019-12-22 08:05:46
问题 I have a plugin that uses apply_filters like this: $additional_fields = apply_filters('attachment_meta_add_fields', $additional_fields); In my theme's functions.php , I do: function addAttachmentMeta($additionalFields) { return $addtionalFields; } add_filter( 'attachment_meta_add_fields', 'addAttachmentMeta', 1, 1 ); But the function addAttachmentMeta never runs. How can I alter my apply or add filter statements to make it so that addAttachmentMeta gets called? Edit: This is a custom plugin

Adding Woocommerce Add to Cart Button to related products and product listing

主宰稳场 提交于 2019-12-22 07:47:11
问题 I'm having some difficulty in adding additional stuffs to WooCommerce as I'm still new to it. I'm trying to add an 'add to cart' button to related products and product listing. Was running through the codes and got stuck at the below. <a href="<?php the_permalink(); ?>"> <?php /** * woocommerce_before_shop_loop_item_title hook * * @hooked woocommerce_show_product_loop_sale_flash - 10 * @hooked woocommerce_template_loop_product_thumbnail - 10 */ do_action( 'woocommerce_before_shop_loop_item

WordPress jQuery Uncaught TypeError: Property '$' of object [object Object] is not a function

给你一囗甜甜゛ 提交于 2019-12-22 05:36:19
问题 I'm converting my html files to a WordPress theme and I'm using the plugin ZClip for copy text to clipboard. The ZClip plugin works fine in my html demo, but when converting to WordPress I got this weird syntax error "Uncaught TypeError: Property '$' of object [object Object] is not a function" in line 288 in the zclip.js file which is $(this.domElement).data('zclipId', 'zclip-' + this.movieId); I think it is something with the variable $ not sure. I read something about the jQuery might get

My settings are not saving in wordpress theme options page

我是研究僧i 提交于 2019-12-21 22:34:12
问题 I am trying to create a theme options page based on WordPress's Settings API. When I go to check the options.php page in my browser (ex. http://mysite.com/wordpress/wp-admin/options.php), I see an entry for coolorange_options but it is empty. This happened after I added a url, width and height to the text fields. So far, I have enough code written to get the information and store it to the database, but not to retrieve it for anything. I referenced a tutorial in the php comment at the top of

Wordpress multilanguage plugin [closed]

旧城冷巷雨未停 提交于 2019-12-21 20:29:20
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 10 months ago . I have a blog on Wordpress in which I need to serve contents in several different languages. I don't want to translate the articles, I just want to have some in each of the languages and just have a way of switching between them. I was looking for a wordpress plugin that allows such functionality but so far I

Change WordPress's login label, “Username”

笑着哭i 提交于 2019-12-21 20:15:11
问题 On the default WordPress login page, how do you change the label, "Username", to something else? 回答1: I think this is a better alternative to the previous answer. function login_function() { add_filter( 'gettext', 'username_change', 20, 3 ); function username_change( $translated_text, $text, $domain ) { if ($text === 'Username') { $translated_text = 'customLoginName'; } return $translated_text; } } add_action( 'login_head', 'login_function' ); 回答2: Simple Solution add_filter( 'gettext',

use multiple files in wordpress plugin - Call to undefined function add_action()

此生再无相见时 提交于 2019-12-21 17:19:58
问题 i'm trying to write a plugin with multi files, i'm sure i did it before without a problem but now i have the problem in the subject. in the main plugin file i included a file name - ydp-includes.php, inside of ydp-includes.php i included all the files i wanted like this: <?php include(dirname( __FILE__ ) .'/1.php'); include(dirname( __FILE__ ) .'/2.php'); include(dirname( __FILE__ ) .'/3.php'); include(dirname( __FILE__ ) .'/4.php'); ?> but i'm getting: Fatal error: Call to undefined function

Can Wordpress posts be rendered dynamically?

给你一囗甜甜゛ 提交于 2019-12-21 17:14:04
问题 I want to make a blog page which is generating content for particular user based on his/her Facebook likes, activity etc. For example I like Shakira and Coca Cola on Facebook. When entering the blog and connecting via Facebook, the blog gets that info and searches for Shakira's YouTube video through YouTube API and shows me the video in a WordPress post. After the blog searches for news connected with Coca Cola and shows news about it also in a post. There is no problem with FB connect,

WooCommerce trigger custom email via AJAX

给你一囗甜甜゛ 提交于 2019-12-21 17:00:15
问题 hi and thanks for stopping by. i am currently writing a plugin for wordpress. i need a button inside a certain page, that triggers an email-notification. i figured it would be good to use the woocommerce email functionality, since it is a customer email and i'd like to use the woocommerce-email-templates, too. in my plugin i include my class extension via function add_wc_custom_email( $email_classes ) { require( 'includes/class-wc-custom-email.php' ); $email_classes['WC_Custom_Email'] = new