In this specific case you could simply follow the logic: determine if you’re on an archive page and what the current post type is. Like this:
if (is_archive() && 'books' == get_post_type) { do your thing }
Or you could use the function specific for checking this:
if (is_post_type_archive('books')) { do your thing }
Related Posts:
- Should I use RIPS tool to test my themes and plugins?
- Workflow and best practice for documentation [closed]
- Override the core function locate_template
- add_action in functions.php, do_action in plugin?
- Reusable functions and tools (Framework)
- How to get current post user id
- Plugin-generated pages use Not Found or Pages Archive templates?
- Is there any kind of theme on WordPress to sell my own movies?
- Homemade plugin while using Themify Ultra
- How do I combine a theme with a plugin
- Create custom pages with a plugin
- How to write “alt” tag in image for wordpress code?
- I receive taxonomy id
- Don’t load the theme for a page FROM a plugin EDITED
- Extending a theme: build new features as plugin or core modules?
- How to check homepage contain blog post?
- How do you create a re-useable HTML fragment in wordpress
- Scrape key check failed. Please try again
- How to override any plugin file in the child theme
- Link custom post type to page
- when i activate my WordPress plugin cannot see customizer options or preview
- How to prevent redoing get_posts queries and make results available to other scripts?
- how to add custom css at top above all css file for specific url
- Why the output of an image gallery plugin is not displayed into a page of my custom theme?
- Input gets deleted/overwritten after changing to different Admin Menu
- Breadcrumb is not generating the correct post page url
- Site is setup statically – how to make it content managable?
- How to escape html code?
- How to make content as required in custom post type?
- What Are Security Best Practices for WordPress Plugins and Themes? [closed]
- Edit plugin without hooks in functions.php
- How to find out if option exists but is empty?
- Trigger a custom wordpress plugin with a linux cron
- update_meta_user difference in i:1 and b:1, how to write b:1
- Registration Form Validation in wordpress
- Add_rewrite_rule doesn’t add custom url in plugin
- Migrating a File from Plugin to Theme and changing its path → instead create a REST endpoint
- How to add inline css/js inside a shortcode
- Is this plugin being loaded before file.php, subsequently not allowing me to use certain functions?
- Hide Theme options and Customize Admin menu
- How do I write into a file (css)
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Where should I save an API key of my user when installing my plugin?
- How to make a customize role and view a specific plugins base on that role?
- How to prevent users to download videos from lms website?
- Allow users of my plugin to define their own shortcode rather than use mine?
- Map Custom Registration Fields to WordPress User Roles
- Child Pages Short Code plug-in and hover capabilities?
- custom payment gateway in woocommerce failed to connect to remote api server
- Ajax call returning 0
- WordPress plugin admin html being shown in Customizer iframe
- WordPress Widget – Saving multidimensional arrays into $instance
- Plugin Options not being output
- Where are theme codes located for WordPress?
- How to get menu location in wp_update_nav_menu hook
- Which wordpress theme is compatible Optima Express theme (real estate inventory) plugin?
- How to Include File from Plugins into Template?
- WordPress Site is Broken, Cannot see wp-admin page [closed]
- How to remove menus items from Menu section from WordPress theme customizer
- Licensing options for WordPress Plugins
- Plugin generated unexpected output – No PHP errors
- Plugin generating unexpected output – on WP mysql dump import
- How to embed a new string in url?
- help intercepting save_post through plugin
- best way to run a php script away from the template?
- What is the most efficient way of adding additional functionaliy for admin only
- Add a new category for posts
- How to save Setting pages data to the database?
- Disable WordPress Theme Browser and Plugin Browser
- Add hook after content without formatting
- Sold out Label for variable products which are partially sold out
- Prevent WordPress from sending set-cookie http header
- admin_post hook not firing function inside class
- dokan edit functionality
- how to auto random increment for post view
- Woocommerce convert simple products to variations
- WordPress Thickbox Navigation Issue in Gallery
- How to save the option’s new values plus old value without overwrite old one
- Not displaying Woocommerce product page in lightbox
- WordPress “template_include” Filter Not Working
- WordPress Media Uploader : How to add custom button on featured image tab
- Change pricing in Woocommerce based on Category and Product [closed]
- Can we validate data from jquery
- Re-writing MySQl query for execute faster
- Woocommerce: deleted single-product.php, everything still works. How is it possible?
- Getting error “The package could not be installed. PCLZIP_ERR_BAD_FORMAT ”
- Building a simple “settings” plugin to change textstrings on the home page
- is there a way I can add or remove some plugin options?
- How to provide access to specific plugin to all the user roles except subscriber in wordpress
- What can I do to customize a widget provided with this plugin? from where have I to start?
- Javascript as Jquery Function Call?
- how to remove a rel=”nofollow” using call to action plugin
- Elementor with system colors instead of kit colors [closed]
- Create Custom Coupon Type
- How to provide page_template path in custom plugin using WordPress
- Prevent primary navigational menu from expanding during page load (WordPress / Astra Theme)
- WordPress custom block: Link saved in database not retrieved when editing post
- Accessing Correct Database to Create REST API Endpoint
- Detect if user is on the specific page in WordPress
- A multi-section WordPress store [closed]