Please add “;” after $i = $i++ and see if that fixes your issue
foreach ($socialIcons as $icon) {
$i = $i++;
$wp_customize->add_setting(
'pxk_href_' . $icon['name'], // use this in twig file call to theme_mod
array(
'default' => '',
'transport' => 'postMessage',
'priority' => $i
)
);
Related Posts:
- Looping through WP_Post Object
- Must Use Plugin Causing Query Error
- How can I add multiple ‘tax_query’ arrays via a loop?
- Checking array against author id in loop
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- How to get the last category name of a child category?
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Only show first image in foreach loop
- Get all posts as an array ID => Name
- in_array not working on dev server but works on localhost
- ACF – Get ID of relationship field in flexible content
- Show the subcategory name based on current product
- make an array in wordpress cusmization api?
- WP_Post is not from correct array
- How to set variable, pass it to a partial file and remove it after?
- how to refresh div on template part?
- Exclude posts based on meta value
- Customizer: Category Select Sanitize
- Alert Bar section within WP loop is displaying even though there are no posts
- Problem custom control Customizer
- remove post that has no content
- Display category name only once inside loop
- Can’t find infinite loop cause
- How do I Turn This Into An if statement?
- Skt full width basic slideshow problem
- Load wordpress content in other domain
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- Checkbox doesn’t stay checked, conten
- post thumbnail, conditions, else wont work
- Widgets in the loop if active
- Alter required message using comment form api
- List posts that don’t have a specific tag?
- Changing the_posts_navigation() html output
- Can we count the WordPress Loop
- Advanced Custom Fields – display label and value only if value entered
- Get post id within comments loop
- meaning of (array)function()
- Syntax error when I try to insert my loop into an unordered list? [closed]
- WP_Query fails despite having 1 post
- Grouping posts by a custom meta value
- wp_force_remove_style’ not found
- Add content after the first post in WP Loop
- wp_query get the 2nd post
- Loop stopped working
- How to check if a Customizer setting is set?
- How to get post ID in a Page?
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- How can I access string value in an array?
- How to use if statement in an array? [closed]
- Custom Pagination is Broken
- Display an image if odd number of posts in grid
- How to loop through all the attached images in a post, and get their url one by one
- How to array only one key from another array
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- Filtering a function’ output for a new continued function
- WordPress Customizer Default Image
- PHP Warning: strip_tags() expects parameter 1 to be string?
- Output meta into arrays
- Store post content in a php variable and output them using for loop
- How to add div blocks after certain set of post
- Get html data with javascript to php array and store to wordpress database
- Echo a shortcode div after every 3 posts
- How to avoid duplicates when creating recent network posts
- How to overwrite orderby with add_query_var
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- How do I create a numbered list with PHP? [closed]
- Why in my theme I can’t see all the statics content under the posts?
- 2nd page displaying the exact same posts as my first page (minus the very first post)
- Is the 404 page automatically displayed if a loop returns nothing?
- How do I remove a category from a wordpress loop>
- How to use array in function to get only value I want
- Error while setting role
- Get categories names as an array to use it in theme settings
- variable value disappears in a second loop
- Last class on last headline?
- Show recent posts starting at a specific number archive
- get_the_ID() in the footer returns wrong value
- How to say if meta_value is greater than 0 in an array?
- How to use two meta_compare in an array?
- Warning: in_array() null given in PHP function
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- WordPress query undefined offset in loop
- Foreach loop inside an array_merge
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- How to unlink all posts from tracking same amount of views
- Extending WP_Customize_Media_Control to return filename
- Issue with custom loop in Archive page
- Please show me how to use an if/else statement in combination with wp_enqueue
- Loop over Array and get the distinct ids
- How to access or parse key/values that have “string”
- If Array Values Match Another Array’s Values, Then
- Remove empty terms from array, sort alphabetically, update back to repeating field
- Why my loop isn’t working? [closed]
- use loop to return blog details
- Conditional multidimensional arrays and array_map
- How to get current post category details inside “loop”?
- How can I get all values from my array in a loop in php? [closed]
- How to pass current loop data into nested loop
- Getting posts to exclude from array
- How to get post ID from button and pass title to Modal