Declare $a
as a global variable, just as you have with $post
:
global $post, $a;
(Keep in mind, you may collide with other variables, since your var name is not really all that unique)
Related Posts:
- Get the ID of the page a menu item links to?
- Add container to nav_menu sub menu
- Does hooking into the same action multiple times drain memory?
- One Child Functions.php for Multiple Child Themes
- Different wp_mail_from and wp_mail_from_name for specific situations
- Disabling pingback and trackback notifications
- register_post_type for Pages?
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- How to get comments with mixed status using get_comments?
- Restrict user registration to emails on a single domain
- Call to undefined add_action() in theme’s functions.php
- How can I rename the WordPress AJAX URL? [duplicate]
- How to add a rel attribute to images that contains their categories?
- Is it possible to be more page/post specific with admin_enqueue_script?
- Passing HTML in WordPress Shortcode arguments
- Can I use require() function in a template file?
- What is the most efficient method for loading widgets in functions.php
- Enqueue script o style only if a template part is loaded
- Can I pass two roles to the function get_users?
- Convert User ID’s to User Names in a single.php file
- Add external js file to footer with id
- password protected post policy
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- Custom Shortcode, functions PHP WP_Query loop
- How can I enable uploading excel files?
- wpautop – disable tags, keep tags
- Logout hyperlink within a sub-menu
- Manipulate Permalink
- Change the HTML of the comment form that is generating somewhere from the core WordPress
- How to customly read JWPlayer’s “Playlist” items by using its “playlistid”?
- Twentyten Child Theme: header images display messed up in admin panel
- How to get the index number of the posts?
- Removing wp_login_viewport_meta
- Get Current Post ID in functions php, meta query filter
- Two Types of settings in WP – The Doubt
- Custom Attachment Caption Fields
- Jquery implementation not working on page reload
- How to call particular funcion when the check box is checked in plugin options page
- Call WordPress function outside of WordPress
- Move Custom Fields on General Settings Page to New Location
- Events: Check for other event with same start date and category [closed]
- Remove adjacent_posts_rel_link under 3.2?
- enqueue_script with filemtime javascript not working
- WP function won’t work on 404 template page
- How to obtain the recent posts without their content in an efficient way?
- Not all CSS elements transferring via parent to child?
- Limit dimensions of “Full” size images
- Where to put random functions?
- Define PHP variable from a seperate API if statement
- Auto-Tweet if Type is ‘Status’ using OAuth
- Output a specific link in WordPress post if the single post’s category’s name contain certain word
- add_filter to specific WooCommerce Category
- How to add custom li item to wordpress menu
- Need To Change WordPress Meta Tags… Includes wordpress shortcodes
- Passing user enetered value in widget: number of words, for example
- More tag locked in Hemingway
- Adding a section in line at the end of the main navigation menu in php
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- Suggest Users basing on User taxonomy
- Code to insert code into single php
- update_post_meta is Updating with two page id
- Custom Image Size in Insert Media
- Custom function for search form
- Custom Menu in Admin doesn’t change menu in browser
- How can I show different content for different user-levels?
- WordPress function bloginfo not echoing output on parts of the pages
- How to change a meta value (of a published post) after X days.?
- sort metabox columns in listing Single
- wp_nav_menu displaying all pages
- How to change text color depending on the number value (Using javascript)
- Updating custom query var with multiple values
- Why should I use get_template_directory() when include files?
- How to display an image before title text in menu items
- WordPress wp_dequeue_script remove all other scripts
- Error in “class-wp-hook.php”
- How to replace ACTION url from original wordpress login form?
- Redirect User Role When on Specific Page
- How to force one script to load before google tag manager script
- Add Javascript code to functions.php childtheme
- Ajax in plugin fails – but only on one blog – no idea why
- I can’t in any way include css in my theme using functions.php
- Problem with email function
- admin-ajax.php 403 forbidden only when calling from external file
- Remove post from latest posts after a month only with certain tag
- Display list of pages that contain a certain string within the slug
- I need to completely ‘wp_dequeue_script’; what’s the best way?
- $content is empty while using DOMDocument
- Change the second role depending on the first
- wordpress not calling peliegro functions.php?
- Problem with add_rewrite_tag
- getExcerpt: Make ellipsis appear only if character limit is reached
- Sanitize html, where to sanitize
- Modify function Shortcode_atts
- How do I change the URL returned by next_posts_link()?
- function to return comma separated list of meta values
- WordPress SEO By Yoast Plugin is interfering with a custom function code – how to troubleshoot and fix it?
- Woocommerce – Checkout error message
- How to get postId from the argument $block when register_block_type()?
- WordPress is adding pagination for all pages not only for blog page, How to remove pagination for all pages except blog/posts page?
- WPDB query suddenly not working