add following code to functions.php,
add_action('wp_head', 'your_function');
function your_function(){
if ( is_user_logged_in() ) {
$genre_url = add_query_arg('aff', '1234567', get_permalink());
}
}
Hope this will help you.
for more information,
Related Posts:
- Use action, filter, or hook to append HTML to WordPress plugin function
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- How can I edit post data before it is saved?
- How to only hook on Single.php after content?
- Use external link in the add sub menu
- do_action and hook methods
- How to filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- Pass info from functions.php to plugin
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Calling plugin function inside custom plugin for onclick event
- Get Time Taken By Each Action Hook in WordPress
- Create a post builder skin in a plugin
- remove_action not removing add_action from constructor
- Plugin Development – Functions or Hooks?
- Are there action hooks for comments?
- How to remove a class function from a plugin by using remove_action()?
- Add action to custom Function
- Hook for altering the content of all wp mails
- How to hook into action/filter call
- Unpublished Pages Failing To Appear On Custom Path
- The function called on the wp head hook becomes null
- How to Unhook actions/filters in within Class in plugin
- Plugin function in child theme
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Passing a parameter to filter and action functions
- change output location of plugin function using a custom hook
- How to Add Extra Text In WordPress Title Before Post Publish
- How To Determine If A Filter Is Called In A Sidebar/Widget Context?
- Customizing subject in comment notification e-mails
- WP showing “warning: call_user_func_array()”, What to do?
- WordPress admin notice in plugin function
- Using the ‘draft_to_publish’ hook (post status transition)
- Filter Hook on plugin update
- Removing user contact methods works from functions.php but not from a plugin
- Failed to invoke other hook from the init hook
- How to prepend to the_title for admin-side plugin’s use
- How can I filter blog name?
- why does the add_action(‘the_content’) overwrite my page
- Fatal error: Class not found in
- Is it possible to remove this action? (as it’s added just before it’s called)
- plugin_action_links_{$plugin_file} hook not in the main plugin file
- Woocommerce Shipping module available only for type of products [closed]
- WordPress Plugin Boilerplate – add_action hook in static “activate” function
- merging an array to an existing array using add_filter
- template_redirect not being called when using ajax
- Plugin custom Action Hook not working
- add_action in functions.php, do_action in plugin?
- WP Job Manager Category Drop-down; Change Placeholder Text Via Filter
- add action for displaying posts using a shortcode
- Randomize attachment IDs
- add_query_arg not working
- Change permalink structure hidden button edit
- WordPress filter that hook after each action/filter hook
- Modify a function without editing template
- Inserting above the comment template
- Insert new user with form submit ‘init’ hook
- Using a post-signup hook to get user details
- How to check current user before all actions and filters?
- get current date + 90 days and checking every day
- Filtering WooCommerce Orders by Category
- Plugin developer automated documentation
- Is there a hook to Intercept al urls from a webpage and redirect to a page
- How to get post ID with hooks publish_post, new_to_publish, etc
- Is there a way to figure out which action/filter invoked a function?
- Add sub menu page in your plugin
- Override the WordPress core function wp_referer_field
- the_post hook is not firing for me
- Hook for page Request?
- Editing wp-config.php
- How to use the pre_option filter before a plugin loads?
- WooCommerce: after install hook
- How to use filter to disable adding a product to wishlist?
- WordPress: Add custom add_filter for custom functions
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- Use a hook or filter, or overwrite this Gamipress function?
- Hook from plugin doesn’t fire up from external PHP script
- WordPress Custom Hook with Class method
- update_option_{$option} not working (do function after options are saved)
- add a hook of Woocommerce to a plugin but it only shows and doesn’t function properly
- Callback hooked to post_updated firing on new posts as well
- Randomize post (and page) IDs on generation
- ACF Fields are not showing up on Homepage
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- How Do I Unhook This Parent Theme Function?
- WPML – Hook when language is switched (change user language)
- Nested Actions and Filters
- Passing function into add_action always returns the first argument
- Why is WP template_include overwritting all templates rather than specified page?
- plugin not hooking to my custom hook
- wp_login_form() ignoring login_form action hook
- how to repeat taxonomy in different places on wordpress
- Plugin Hook: Get posts
- making a glossary with wordpress
- Which filters or actions involve with index page for plugin?
- WP Members additional fields on user profile [closed]
- Call a function with href
- Which action/filter can i use for a Member Plugin [closed]
- How often should I execute add_filter and function declaration in Code Snippets?