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?
- How to create new title and its description inside a section in WP Customizer?
- Custom page template from plugin does not work with pre-installed themes in WordPress 6.6.1
- Creating a WordPress admin page without a menu for a plugin
- Common functionality between my own plugins
- How To Ignore a Filter On Applying Filter the Content In a Function
- Which functions in theme or plugin load first
- Adding Image in readme.txt file of wordpress plugin
- Saving Plugin settings to the database
- Add CSS animation as Preloader to WordPress
- remove custom taxonomy metabox form custom post type
- $wpdb->get_results() does not fetch results with unicode ‘WHERE’ clause
- WordPress plugin installation
- Get image URL from media library in input
- How could I execute my plugin just in frontend (not in backend)
- Custom height/width for thickbox in WP Backend
- add action wp_head not working
- Deactivate Plugin on Theme Switch
- Next and/or previous post content
- How To Clean The Malware Infected & Hacked WordPress Websites? [duplicate]
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- Re-naming a theme/child theme whilst maintaining updates
- Single API call exposed via shortcode with params
- What would I need to write into a custom plugin in order to add a switch for a custom string of CSS to the edit page?
- How to deal with WordPress and Pocket API to automate content curation on my hosted wordpress blog? [closed]
- ob_start() combined with wp_query
- Theme/Plugin installation through url on button click
- Ordering taxonomies by rank
- Plugin Options not being output
- Can I create a table on my DB without creating a plugin?
- Submit Form data to another page via Ajax (WordPress Way)
- add_submenu_page returns null
- Plugin generating unexpected output – on WP mysql dump import
- Remember the Meta Value With Radio Buttons
- 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
- How do I work with the SlideDeck plug-in?
- 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
- User loggedin as Subscriber form not sending
- wc_get_template_part doesnt display the content [duplicate]
- Prevent WordPress from sending set-cookie http header
- admin_post hook not firing function inside class
- Thumbnail image doesn’t show up in Shortcode output
- dokan edit functionality
- how to auto random increment for post view
- how to split and upload a theme on wordpress?
- Fatal error: require_once(): Failed opening required
- How to save the option’s new values plus old value without overwrite old one
- Not displaying Woocommerce product page in lightbox
- how to add navigation icons in specific template?
- 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
- Shows warning when enable “wp_gallery_custom_links” plugin with Themify Builder
- WordPress environment not loading properly
- Speed issues because of CSS & JavaScript
- how can i get records from wp_postmeta table using particular meta_key in database?
- Re-writing MySQl query for execute faster
- Getting error “The package could not be installed. PCLZIP_ERR_BAD_FORMAT ”
- How to provide access to specific plugin to all the user roles except subscriber in wordpress
- Output pure JSON wordpress
- how to remove a rel=”nofollow” using call to action plugin
- Create Custom Coupon Type
- Is it possible to create post in wordpress using postman?
- Read page- or post-content across different builder-plugins
- How to make WordPress Plugin run on single specific Admin Page
- Frontend Enqueued Files in the Backend