You have to return the output with the value. you can check the following code.
function hello_shortcode() { // Load field settings and values. $field = get_field_object('producent'); if( ! is_product_category() ) { $checkbox = $field['value']; } else { $checkbox = $field['label']; } $output="‹p›".$checkbox.'‹/p›'; return $output; } // register shortcode add_shortcode('hello', 'hello_shortcode');
Related Posts:
- How to store ACF custom fields data in a custom table
- Redirect to another page using contact form 7? [closed]
- ACF – How to set the menu order for the relationship field
- How to create repeater field manually, without plugin (ACF Pro)?
- make p tag collapsed after 3 rows
- Pulling Advanced Custom Fields from other pages
- ACF: Hide a div or template section when a custom field (in a field group) is empty
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- Consuming an external API in WordPress?
- How can I import a class privately into a plugin?
- How to Loop Plugin Option Field Set?
- Updating WooCommerce variable product stock issue
- How to Create a Directory in a Plugin Folder?
- Create plugin that works in background
- Checking for user role in a custom plugin
- White text on white background in TinyMCE when wp_editor is called in WP 3.9
- HELP: Integrating WP with raw PHP code once published button is hit
- How do I add advanced custom fields / meta fields to Elasticsearch? [closed]
- Loading class files via autoload method
- How to redirect Old Post URL to new Post and keep Old post Comments?
- Modifying Footnote Plugin for Descriptive Title Attributes
- I would like to use create a function in my custom plugin to tell WP to use a different header
- jQuery function didn’t work in my plugin
- bulk change of image setting “link to” to “link to: image url “
- Escape when echoed
- add_meta_box (Will display only in specific page admin WordPress)
- Make id column as AUTO INCREMENT on plugin activation
- WP_Query ordering numbers as letters
- Sending email from inside a plugin using PHP PEAR
- Notepad sticky plugin
- WooCommerce Custom Product to checkout
- How to stop or remove an action being called inside a function of an extended class
- Adding an Options Page to a Plugin
- How do I “get the next 10 posts after post_id == x”?
- How to simultaneously access the same MySQL database in the main column and sidebar of WordPress?
- Date calculations from 2 custom fields
- Easiest way to add dropdown to a page
- Adding a new field to the address field type in gravity forms
- Show admin notice on incorrect value on form field
- Customizing NEXTGEN Gallery To link images to pages
- WooCommerce specifc variations for specific user role [closed]
- Nested shortcode functions accessing variable
- Ability to automatically redirect a URL
- Passing Page ID used in Meta Box Creation to JavaScript
- Activate my plugins via FTP
- Is wp-app.php or wp-apps.php needed for WordPress?
- How to add apply_filter for a class property in plugin
- Warning: Use of undefined constant list_all – assumed ‘list_all’ (this will throw an Error in a future version of PHP)
- How to distinguish if a plugin is not installed or just not active
- JavaScript in a PHP plugin
- Checking the count within a foreach loop
- Slashes stripped in ACF
- Is there a function to list all uploaded images? How can I add one?
- A server-side hook failed when committing plugin code to SVN
- Content-Security-Policy Headers are there and showing the correct settings, but still getting a refused connection
- Need to replace Currency Shortforms
- Api external with wordpress
- How to delete all categories programatically?
- How to use custom Javascript code inside a plugin?
- How to use printf to output two links?
- File Uploader – Upload without adding to Media Library
- Building a plugin into a theme
- 2 wordpress site same database
- How to redirect to a page after the form is submitted
- Trying to include files in plugin isn’t working
- WP Insert Post If user refreshes override new post
- How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?
- implement custom roles in custom plugin
- How to get current cart values using WC_Shortcodes?
- How to authorize viewing and clicking a function only logged users?
- Plugin which unlock free gift when you reach some amount in cart
- is there a way to display product gallery images via cdn
- Problem with Date translation in WordPress
- How to assign a specific service to a specific provider based on location
- How can I create a secure file download in WordPress?
- How can I see $post object in frontend from functions.php?
- Move plugin pages from dashboard to front-end
- 500 Internal server error wp_handle_upload_prefilter
- Ajax call to php function doesn’t work PHP code
- Python in WordPress – A “Hello World” implementation
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- WordPress PHP error getting posts from another wordpress blog
- Returning incorrect $post->ID after installing plugin
- Nested DIV’s across functions in PHP, do not seem to work
- How to insert image into the Settings Page of a Plugin?
- Creating new option (add_option) from AJAX – Settings API
- Paginated Comments “reply” does not work!
- How to limit each front-end user to view just his own uploaded files on Amazon S3?
- I created a custom form in HTML/CSS and now I need it to submit … should I create custom PHP or is there a plugin I can use?
- AJAX doesn’t pass variables to the php function in the plugin
- How to add a handler for a button in plugin?
- Move related products after product summary? [closed]
- wordpress select multiple options and illegal string offset ‘timeslot’ [closed]
- post_exists() returns a 0 but the 0 doesn’t register [closed]
- Visual Composer Data Source?
- Woocommerce disable checkout on specific day
- How to debug periodic performance issue
- Foreach retun in shortcode
- How to change and edit users according to the extension in the URL
- How to add a static image inbetween the product tiles on main shoppage woocommerce?