You can use is_admin(); in your if query , http://codex.wordpress.org/Function_Reference/is_admin
Related Posts:
- How can I create a bash install script for my WordPress sites setup (WP+plugins+theme)?
- How to call a plugin function from index.php
- Sending all emails using SMTP
- __(): What if I have to pass in a variable?
- Custom Taxonomy in plugin and template
- How Does WordPress Uninclude/Deactivate A Plugin?
- Where can I propose a new plugin?
- Woocommerce checkout page custom checkbox ticked
- Disallow a user to post in certain categories
- Why allow overriding crucial pluggable functions wp_verify_nonce and wp_create_nonce?
- What is the proper filter to add html to a post / page title?
- Back End Interface Plugin
- How to edit plugin’s html? [closed]
- Force wordpress to request for FTP Info on theme/plugin install/update
- Add a Custom Permalink option in the Permalink Admin Screen?
- Can’t use the built-in wordpress install/upgrade plugin feature [closed]
- publish_post plugin hook doesn’t always pass $post->post_content
- Extensible code
- WP Customer Reviews – shortcodes
- Setting Custom Email From name and email address in wp_email()
- Show only preview of posts on the homepage?
- How to get a Jewish/English event calendar on a page in WordPress?
- Set the active Navigation Menu from a plugin
- Make menu page link inaccessible or disabled
- Advanced Custom Fields plugin – get text from editor field and save it in a variable
- Disable plugin per user role
- Archive – same title for the first two posts
- Build a list of partners with Link, Logo and text
- CSS from textarea in options page to frontend what to do
- Overide plugin files from child theme (/inc/ ) folder
- Rewrite rule not matching
- Call specific plugin update
- Add ALT attribute to Pin It Button image to pass HTML5 validation
- Proper way to replace the_content only for pages created by custom plugin
- Add category selection to custom post type (plugin)
- How to install plugin only from PHP file?
- Add sub menu page in your plugin
- Certain functions are undefined when called form mu-plugins
- Custom Post Type Fields
- wp_head is too slow
- Only allowing some emails to create an account [closed]
- AJAX on Front-End Button Click not working – Custom Plugin
- Why does my file_exist check fail?
- How do I get the user ID of the user that was updated in WordPress?
- How to handle WordPress Plugin Front-end AJAX Call [duplicate]
- Migrating Asp.Net site to WordPress site
- Get ‘Headers already sent’ error for the plugin I am creating when I try to login
- Plugin to email a post or page to someone
- Some WordPress Posts are automatically becoming comments on other Posts
- Always get creating a new table with foreign key
- Best way to duplicate specific page content across two sites?
- Search users with custom meta data
- How to change layout of shop page in wordpress? [closed]
- If post exists in the database – each time goes on `else`
- How can I achieve this, using shortcodes
- Multiple images per post – Show random image elsewhere
- Edit part of a post
- Display hReviews from other websites such as yelp on your site?
- How to fix these PHP Warnings with the “Feed JSON” plug-in?
- How to Join wp_posts & wp_postmeta table using custom query
- Use localized plugin name and description even when the plugin is disabled
- how to show new field if option selected?
- Randomize post (and page) IDs on generation
- Cron task gets removed from the schedule
- My wordpress local urls is still displayed even moved to live
- How to store a custom theme and update it on other installations
- How to Unhook actions/filters in within Class in plugin
- One time call to external API in widget
- Hide Featured Image in AMP
- WordPress filter from custom table is not working properly
- How to show private pages based on a user’s role?
- How to restrict the user from viewing comments but with option to write comments?
- Dynamically Modify s2member Options
- WordPress scheduled event not working
- What action/hook do I need to register to have my plugin handle front-end editing?
- Plugin with AJAX on subdomains causes 404 in console
- Do something with thumbnail image on post publish
- Create csv file in plugin
- Option page not updating multiple records in settings api
- WordPress plugin addon [closed]
- The plugin generated XXX characters of unexpected output…help?
- Using “Authy Two Factor Authentication” in custom login page
- Thumbnails have stopped generating correctly
- Managing database tables in WordPress multisite
- get_posts() method and paging is not working
- WooCommerce doesn’t show UK countries in the shipping options [closed]
- plugin for different writers [closed]
- What is the source outline for a basic word press plugin?
- WordPress Site in Multiple Languages
- How to edit a non logged in page?
- Woocommerce Product Page Collapsible Box Using CSS
- Different login and logout for wp-admin while using buddypress
- How can I make a function work only for desktops and not for mobiles?
- remover item do carrinho na página de checkout
- Changing the “OT Process” Plugin’s Default Slug of /process/
- What’s the best way to update my WordPress theme to Elementor?
- How can I make a function work differently for desktops and for mobiles?
- Why my widget is not visible in the WordPress theme Twenty Twenty-Three
- How to create specific wordpress Table
- WordPress Gutenberg Custom Block the viewScript does not get loaded on the frontend when my block is inserted