I don’t think your code should work. You have to add_action
to some hook (this function takes at least 2 params and you only use one of them).
add_action( $tag, $function_to_add, $priority, $accepted_args );
Also there is no script called float-left-right-advertising
registered by this plugin.
Something like this, on the other hand, will work:
function disable_flradv() {
if ( is_home() || is_front_page() ) {
remove_action('wp_footer', 'append_code_to_body');
}
}
add_action('wp', 'disable_flradv');
PS. You also have to be careful, if you want to use is_home
(and so on) functions. You shouldn’t use them before wp_query
object is initialized.
Related Posts:
- Adding a second email address to a completed order in WooCommerce [closed]
- Advantages and disadvantages of using automatic-feed-links
- How to change the markup WordPress inserts for post images
- Change meta tags programatically
- Convert hyphen to underscore in permalinks
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- Use a function to update post meta based on other post meta
- wp_mail not running inside Cron
- Remove product description from product archive page
- Logging in redirects to correct page but shows logged out content until forced refresh
- Adding body class when post contains a specific shortcode
- Displaying Widgets
- How can I stop a function from encoding an entity?
- Display WooCommerce subscriptions for user [closed]
- Increment price for Woocommerce Minicart [closed]
- Change woocommerce products weight varation based its product category or tags? [closed]
- Function to “Press Update Button” on all posts
- Completely disable RSS feeds on WP 5.5.2 and show a 404 page instead of die();
- Check if row exists before inserting
- Missing argument 2 for a custom function widgets_init
- Removing the main link to Jetpack from the menu
- Defining a global array in functions.php?
- Get the 5 lastest Featured Posts from a category
- How To Remove Duplicate Menu Locations
- Set quantity of woocommerce product on page visit [closed]
- get_post_type() in in_array doesn’t work for some reason
- Is it possible to change any of the HTML/URL returned from the_category()
- Show top commenters without using a plugin
- How to remove set_post_thumbnail_size() in child themes?
- Post thumbnail not showing in WP admin area for custom post type
- Backstretch.js and thumbnail sizes to reduce loading time
- Child theme within a child theme?
- Fatal error: Cannot redeclare when switching themes
- How to load jQuery in the footer – nothing works for me
- Featured Image Thumbnail Creation
- Updating Media Published Date When Parent Post Is Modified in WordPress
- WP Ajax Function Always Returning undefined
- How can I grab the video id of youtube?
- Specify number of posts for sub-category page
- how to en-queue jQuery to load before the tag
- Passing variable as add_shortcode argument
- comments_popup_link without echo?
- Can’t filter wp_get_attachment_link
- Impossible to call wordpress function inside an include?
- How to customize the_archive_title()? Cannot figure out how to change the value it produces [duplicate]
- Remove a category from a post when saving a new post
- Want to dequeue all the CSS and JS from /wp-content/uploads/xyz-folder
- add_action wp_enqueue_script priority level only works for admins
- Scripts not loading when using the wp_enqueue_scripts action
- Is there a way to direct unregistered user to registration page when click a link?
- Auto log in hook is requiring a page refresh
- Testing for a shortcode using a function. 404 page throwing PHP Notice
- how to get the post ID from wp_insert_post
- How to get post revisions in my custom rest API? [closed]
- Possible to merge these two functions?
- Strip div From Excerpt
- The Capability to choose post/page template
- The_content and Preg_replace in loaded Iframe [closed]
- dynamic site link for future migration in echo do_shortcode()
- Hide tab Buddypress profile for visitors, not logged in users
- Image Crop Not Working
- Add a mature content warning to first-time visitors
- Show Featured Image in else statement
- Function to check if custom page is used by page?
- Simplest Way to Build Custom Archives Page?
- Filter for replacing the WP_query object for a given category
- Custom user role still showing up after deletion, ideas?
- wordpress built-in Jalali date convertor
- How to Display WooCommerce Product Price in WooCommerce Archive
- WordPress Function Assistance with Loop
- Bizarre Child Menu Issue on WP Site
- Populate acf-field, depending on block name
- get variables data from functions.php to template wordpress (without global variables)
- Add Change role button for list of user in an event
- I am trying to set post terms to a custom taxonomy
- how to increase connection time
- Shortcode to insert default text and change one word throughout it?
- Its my first time trying to create a website , I got an error Please help
- Classic TinyMCE messing up only Contributor’s HTML
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- Add schema to Search result page’s body. Tried using is_search
- Drop down list code for sidebar
- Shortcode Initialization in a Custom Theme
- Hide disclaimer from summary excerpts
- Load scripts into an AJAX div
- Restricted images only for logged user. (hidden url)
- WordPress Javascript Widget jQuery Dependency Issue
- Open image size links in a page instead of direct image link
- Allow tags and attributes in post and pages content
- Override parent theme function that is not hooked or in the functions.php file
- Syling Custom Fields echo’s from from functions.php
- Function to get thumbnail img source
- Syntax for a function in order to get post’s title in JSON encoded response [closed]
- Comment Function
- WP Custom Comment Callback Not Responding
- Do something when user creates post (that’s pending)
- Add product to cart from functions.php
- How I can show short content with short tag
- Comment turned Invisible
- How to add more than one menu for logged in members?