我发现了这个自定义字段插件 - http://wordpress.org/extend/plugins/more-fields/
现在我只想知道如何实现更多字段,我已经安装了插件,创建了字段,并在字段内容中添加了帖子,但前端没有显示任何内容......
我一直在搜索,但无法找到有关如何执行此操作的任何文档.
如何让字段显示在前端?
我是Project Server开发的新手,想知道是否可以使用PSI来设置资源自定义字段值.
我似乎无法为此初学者找到任何信息.
我目前为CustomFields和Resource Web服务设置了Web引用,但我不确定如何为特定资源设置自定义字段.
任何帮助将非常感激!
谢谢!
我想在管理面板的"客户帐户"标签中添加自定义属性.我正在使用magento 1.6.2.我读过许多博客但无法实现它,因为文件Mage/Customer/Model/Entity/Setup.php在CE 1.6.2和CE <1.6.0中有所不同.所以无法找到正确的答案.如果有人这样做,请帮助我实现它.谢谢
我正在使用Sugarcrm 6.5,我想问我是否可以在主表而不是cstm表中创建字段.现在我通过这个帖子创建自定义字段 http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_7.1/70_API/Application/Module_Loader/90_Package_Examples/Creating_an_Installable_Package_that_Creates_New_Fields/这种方法自定义字段添加到CSTM表
当我环顾四周,这下面的帖子(最后一个回复说有可能)
http://forums.sugarcrm.com/f3/how-take-out-_c-when-creating-custom-field-56452/
我在我的网站上使用高级自定义字段.
我有一个名为anime_par的转发器字段,sub_field称为animateur.子字段animateur是一个后对象.
我在我的页面中的循环中使用它,这个循环显示自定义帖子类型中的类别的帖子.
我要做的是在我的页面中显示animateur选择的帖子名称和帖子链接.
这是我正在使用的代码,但它不起作用,它显示我当前页面的永久链接,而不是在自定义字段中选择的代码.
<?php while(has_sub_field('anime_par')): ?>
<a href="<?php echo get_permalink('the_sub_field("animateur")'); ?>"><?php echo get_title('the_sub_field("animateur")'); ?></a>
<?php endwhile; ?>
Run Code Online (Sandbox Code Playgroud)
有什么建议使这项工作?
谢谢你的帮助,
在WordPress博客中,我想在每个帖子add_post_meta中使用,如下例所示:
add_post_meta( 7, 'fruit', 'banana', true )
Run Code Online (Sandbox Code Playgroud)
如果我想在以后为这篇文章设置不同的水果,它会发生什么?我的意思是价值将被替换或添加?
我只是想确保它总是被覆盖并替换为新的(总是1值),而不是添加.每个帖子都会有其价值.
我最近将Algolia Search Wordpress插件实现为我的客户端的新WP版本.该网站将主要用于收集调查数据,并为其管理员提供强大的搜索功能.
我创建了一个自定义帖子类型,其中包含每个调查提交的唯一帖子.每个调查输入字段都被推送到帖子中的自定义字段.
在下面的示例中,我正在尝试实现Algolia的自定义字段推送和检索功能:https://community.algolia.com/wordpress/advanced-custom-fields.html#push-custom-fields-to-algolia .我的自定义帖子类型标题为"提交",我正在尝试在该帖子类型中使用"organisation_name"键来推送自定义字段.同样,我认为我已正确设置所有内容,但此自定义字段未被Algolia索引.任何帮助将不胜感激.
// Push custom fields to Algolia
add_filter( 'algolia_post_shared_attributes', 'my_post_attributes', 10, 2 );
add_filter( 'algolia_searchable_post_shared_attributes', 'my_post_attributes', 10, 2 );
/**
* @param array $attributes
* @param WP_Post $post
*
* @return array
*/
function my_post_attributes( array $attributes, WP_Post $post ) {
if ( 'submissions' !== $post->post_type ) {
// We only want to add an attribute for the 'submissions' post type.
// Here the post isn't a 'submission', so we return the attributes …Run Code Online (Sandbox Code Playgroud) 以下是WooCommerce自定义产品,其中包含自定义字段,自定义标签及其内容:
我正在此选项卡上对第一个文本字段进行采样.目标是获取这些字段的"标签"属性.
function launch_product_tab_content() {
global $post;
?><div id='launch_contents' class='panel woocommerce_options_panel'><?php
?><div class='options_group'><?php
woocommerce_wp_text_input( array(
'id' => '_text_announced',
'label' => __( 'Announced(Global)', 'woocommerce' ),
'desc_tip' => 'true',
'description' => __( 'Year and Month it was announced global', 'woocommerce' ),
'type' => 'text',
) );
woocommerce_wp_text_input( array(
'id' => '_text_announced_ph',
'label' => __( 'Announced(Philippines)', 'woocommerce' ),
'desc_tip' => 'true',
'description' => __( 'Year and Month it was announced global', 'woocommerce' ),
'type' => 'text',
) );
woocommerce_wp_text_input( array(
'id' => …Run Code Online (Sandbox Code Playgroud) 在WooCommerce中,我已经能够在“编辑帐户”页面中添加自定义字段。我尝试添加第二个自定义字段“ Favorite Color 2”,但无法正常工作,这是我做错了。
如何在“编辑帐户”页面中添加/保存其他自定义字段?
// Add the custom field "favorite_color"
add_action( 'woocommerce_edit_account_form', 'add_favorite_color_to_edit_account_form' );
function add_favorite_color_to_edit_account_form() {
$user = wp_get_current_user();
?>
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
<label for="favorite_color"><?php _e( 'Favorite color', 'woocommerce' ); ?>
<input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="favorite_color" id="favorite_color" value="<?php echo esc_attr( $user->favorite_color ); ?>" />
</p>
<?php
}
// Save the custom field 'favorite_color'
add_action( 'woocommerce_save_account_details', 'save_favorite_color_account_details', 12, 1 );
function save_favorite_color_account_details( $user_id ) {
// For Favorite color
if( isset( $_POST['favorite_color'] ) )
update_user_meta( $user_id, …Run Code Online (Sandbox Code Playgroud) 这是一个有关如何为我的WooCommerce订单添加添加购物车项目元和订单项目元的插件。最初,我的以下代码在输入type = text上运行良好。它返回值的标签和输入的值。
转换为type=checkbox代码后,将返回label并value="on"检查代码。
我想返回已检查值的唯一值名称(忽略未检查的值)。
重构以帮助包括更多复选框选项将有助于减少书面代码。
我的代码:
<?php
global $woocommerce, $product, $post;
add_action( 'woocommerce_before_add_to_cart_button', 'add_fields_before_add_to_cart' );
function add_fields_before_add_to_cart( ) {
?>
<div class="simple-selects">
<div class="col-md-6">
<h3>Main meals</h3>
<p><input type="checkbox" name="mm_chicken_cutlet_bento" id="mm_chicken_cutlet_bento"><?php _e( "Chicken Cutlet Bento", "aoim"); ?></p>
<p><input type="checkbox" name="mm_roasted_pork_rib_bento" id="mm_roasted_pork_rib_bento"><?php _e( "Roasted Pork Rib Bento", "aoim"); ?></p>
</div>
</div>
<?php
}
/**
* Add data to cart item
*/
add_filter( 'woocommerce_add_cart_item_data', 'add_cart_item_data', 25, 2 );
function add_cart_item_data( $cart_item_meta, $product_id …Run Code Online (Sandbox Code Playgroud)