The _n
(see Codex) function accepts four arguments. The first two are texts to be translated (the first is singular, the second plural), the third argument is a number (in this case $count
). When $count
is 1 the first string is used, otherwise the second string is used.
So in fact the first instance of $count
is only used to determine whether the single / plural text should be used. _n
then translates that string, using the plug-in/theme domain – i.e. the fourth argument) and the language set in the wp-config. This then returns a translated string such as:
Se han publicado %s artículos
The printf
then echos this string with the %s
replaced by the second argument, $count
(which is the second instance of $count`) .
Related Posts:
- Auto Linking Words But Only One Time
- How to remove spaces from a string using JavaScript?
- How can I input a single right-to-left paragraph (Hebrew) into an English page/post?
- Displaying fractions in text
- Global, network-wide shortcodes or text replace functions
- string translation in functions.php not working
- How to copy/paste web content with photos into my blog
- Custom color does not stick
- Post specific text based on category displayed
- Instructions/Rules Inside Text Area
- Add default text to multiple wysiwyg editors
- Store unmodified text content in database
- How can I highlight specific pieces of text within a blog post?
- copying text from ms word to wordpress post appears weird [closed]
- Text Stating the Domain Name Appears on Every Page… How to Get Rid of It [closed]
- If custom image header does not exist display text header
- How to query an out put value?
- Check & remove special characters in a field?
- How can style text like this in wordpress
- Replace text in excerpt
- WordPress live, custom text box validation, how to?
- How to replace characters in CPT posts with a newline using Better Search Replace
- How can I add diffrent editable text fields?
- Theme Twenty Seventeen – Increasing Font Size for the Home Text
- Theme Twenty Seventeen – Make Margins Smaller So That Text is Wider
- Space between text elements (title and content) in text editor
- How to display text on product catalog
- Change values on several pages
- How can I quickly style a single word with a single keypress (or the most minimum keypresses)?
- How to add a static text at end of a wordpress permalink
- How to add text before posts
- Translate site in own text-language [closed]
- Move text from the side of image to below image [closed]
- How do i edit text that is not in the customization menu
- How do I enable the text editer in my WordPress theme? [closed]
- Radio button problem using subtitles and mandatory field check
- How to place Text and an Image next to each other in HTML?
- WordPress objects class reference
- modify all posts of a category to “no comments allowed”
- Menu Link Redirect Based on Username or User ID
- How do you add pages on a staging server, and then move them over to production
- Theme Twenty Fifteen: Customize Color Scheme Customizer
- How to handle security on a wordpress site? [closed]
- display order of connections
- How can I add data to a custom column in the Users section of the wordpress backend?
- Last post is not showing up
- Volume mounts when setting up WordPress with docker [closed]
- Version control for both Vagrant config and themes being developed [closed]
- open all .docs in word online
- Include user defined styles without including wp-load
- Preserve custom URL parameter after saving post
- A question on creating filters for custom posts using taxonomy
- Captions for More Fields groups, not just individual fields
- WP for main site and two blogs – implementation
- How to make condition, based on custom fields value?
- How can we display product price $104 on the cart while the credit card payment method is checked?
- custom theme ,add media not showing images in media library
- Get product variation attribute titles – WooCommerce
- I want to allow the use of a data-flw attribute in links in comments
- Best practice – pages – ACF or inline coding
- ERROR: Your feed is invalid (after update WP4.7) in custom types
- show random image in loop if image is not set
- wpdb custom tables without plugin
- How to deactivate the text, that appears, when you hovering over topbar tabs? [closed]
- Add a searchbox to the body of a page
- Check if CTP category taxonomy is set in shortcode
- How to add css option to Header Image customizer?
- Reusing header.php from Yii application
- how to nest specific category thumbnails inside different containers
- Disable save as image on smartphones using all browsers ( chrome, firefox, ie, cm, opera )
- Get text from user and display it on page
- Custom meta boxes not saving
- meta_query with array as value with multiple arrays
- Can’t create new CPTs when menu hidden
- How can I specify the width and height of the Featured Image in TwentyTwelve theme?
- Extract Information from post content (using regex?)
- Customise Grouped Product display in Woocommerce with custom column
- Page flickers in customization mode
- When is the wp-settings-[time] cookie generated?
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- Trouble with custom login page
- I want to use a product thumbnail completely different than the product image
- How can I edit the WordPress menu link to allow fb: instead of http
- Dev and prod on the same database- dev version active for IOS
- Flexslider empty slide
- Custom Form Input not saving to Database
- Need help to structure our a complex hierarchy
- One Post with different content, depending on a Page
- How do you add Author and date Published on Category Pages?
- Custom terms in custom category taxonomy
- display certain category on custom template page
- Setting Custom WordPress “Posts page” AS “Front page”
- Display “a generated one [avatar] based on their e-mail address”
- Inserting two categories
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- WordPress Code Access to Restricted Content without Registration
- How to delete unnecessary custom post types in the UI
- How to pre-set WordPress settings for specific posts?
- Add Custom postmeta Fields to Custom Post Type RSS in wordpress
- Instead of Custom CSS Theme CSS is loading