Disregarding for a moment the comments telling you to avoid user agents (because they are error prone and will probably fail on some devices – as you can see from the constant stream of bug fixes on the plugin), the answer to your narrower question is: it doesn’t matter.
If A and B are independent of eachother, as in this case, there is a logical equivalence between if A then if B do C
and if B then if A do C
and if (A and B) do C
.
It could be different if a lot of processing time was involved in checking the user agent and there would be a page condition where you didn’t need a different version for mobile. But as you state it, you always have to check both user agent and page type before you start doing something. Then the order doesn’t matter.
Related Posts:
- Change Image Sizes for Mobile Theme
- How to detect mobile devices and present them a specific theme?
- Is wp_is_mobile() effective?
- How can I set image sizes and still have responsive images using the srcset attribute?
- Excess White Space Above Admin Bar on Frontend Using Twitter Bootstrap
- Featured Image in 4.4 should be larger on mobile device
- How to use the responsive images feature from WP 4.4 in your themes
- how to implement wp_is_mobile on themes?
- What tags should be used for themes to show the type of layout?
- What is the correct way to do a mobile theme for WordPress?
- Free starter theme to make mobile websites? [closed]
- Meta tag viewport
- Can’t show custom post thumbnail sizes as background images
- How does a mobile WordPress theme differ from a simple theme?
- How to make wordpress theme iframe responsive
- Divi – How can we show background video on mobile
- Responsive Images – crop don’t seem to work
- Issue with loading mobile specific custom single page layout in mobile
- Custom image size vs CSS sizing
- Change Responsive Images Maximum Width of 1600px
- Migrating to WordPress – but how will it do “structured” data?
- How do I provide for multiple crops of the same image in a theme?
- Review site using WordPress
- Create theme for mobile phones and tablets only?
- How to hide custom sidebar on mobile
- two col layout bootstrap 4 with one fixed col and fade in effect on image
- add class to all images inside the content
- Menu is in Reversed order
- Responsive Images with art direction
- Reliable method to detect mobiles
- FitVid not working for iframes on particular theme install
- Set start page depending on screen width [closed]
- How to resize video lightbox popup in wordpress? [closed]
- Elementor Pro and Astra have different breakpoints – how to salvage?
- Correct way to make a custom block theme responsive
- Bootstrap 4 mobile menu not working for WordPress Development
- How do I work with responsive images in WordPress? (img srcset/sizes)
- Create a fixed three column layout in theme.json
- Menu items description? Custom Walker for wp_nav_menu()
- How to define and link full path to css located at a random folder on header.php
- Sizing screenshot.png without losing aspect ratio
- Software for WordPress Theme and Plugin Development? [closed]
- When to use is_home() vs is_front_page()?
- What is the preferred way to add custom javascript files to the site?
- Get the blog page URL set in Options
- How to create .pot files with POedit?
- How do I get the theme URL in PHP?
- Why when I submit a form in wordpress it loads a 404 page though URL is correct
- What is the constant WP_USE_THEMES for?
- Worthwhile to restrict direct access of theme files?
- How Do I Protect My Premium WordPress App Theme from Copying?
- Using wp_add_inline_style without a stylesheet
- How to add posts to custom menus?
- WordPress Theme Preview Image
- How To extend WP_Customize_Control
- What is the difference between front-page.php and home.php? [duplicate]
- How can I get page slug
- Does the functions.php file ever get called during an AJAX call? Debug AJAX
- When to use _e and __ for the translation?
- What is a Theme textdomain?
- How to show a custom meta box on the “Quick Edit” screen?
- How to add CSS class to custom logo?
- Proper usage of wp_is_mobile()?
- How to add custom css file in theme?
- How important is it to enqueue a theme’s stylesheet?
- CSS not updating in browser when I change it
- Display Search Result Count
- wp_nav_menu(), how to change class?
- theme path in javascript file
- Display Menu Name using wp_nav_menu
- Making update notification functionality for my themes
- What questions do you ask when asked to give an estimate on theme development?
- How to remove dashicons.min.css from frontend?
- How do I remove a pre-existing customizer setting?
- Minimum Template Files for Theme Development
- What’s the difference between home.php and index.php?
- pass object/JSON to wp_localize_script
- get_template_part vs action hooks in themes
- Theme Activate Hook
- Solutions for generating dynamic javascript / CSS
- wp_redirect() – headers already sent
- Can I create my own “Recent Posts” widget or customize the existing one?
- Custom single template for a specific category
- how can I add an icon/image for a child theme?
- How can I add a URL field to the attachments window?
- The the_post_thumbnail without srcset?
- The proper way to include/require PHP files in WordPress
- Get the first image from post content (eg.: hotlinked images)
- after_setup_theme always runs
- When to use add_action(‘init’) vs add_action(‘wp_enqueue_scripts’)
- Getting failure when using filemtime() with wp_enqueue_style
- Do I actually need to link my theme’s style.css in the theme files
- Why is wp_head() creating a top margin at the top of my theme header?
- How to store widget fields data as an array?
- How do I add version control to my workflow?
- Using classes instead of global functions in functions.php
- WordPress API Menu/Submenu Order
- How can I display a menu on certain pages only?
- Enqueue a stylesheet for login page and make it appear in head element
- Adding a div to wrap widget content after the widget title