You probably want to drop the conditional during init. You are just registering the script here, not enqueueing it. Once registered, you should be able to call the script later in the action sequence. Please try something like this:
function myplugin_css() {
if ( is_page( 'myinfopage' ) ) {
wp_enqueue_script( 'RGraph' );
}
}
add_action( 'wp_print_scripts', 'myplugin_css' );
Related Posts:
- wp_enqueue_script adding conditional statement not working
- Check if first paragraph is an image, then show custom code right after it?
- If post author role is X
- Can a conditional statement apply to part of a slug?
- Add default content to posts in a specific category?
- is_front_page, is_page(‘slug’), is_page(id) not working
- Need help on creating If-statement for custom meta fields
- How to make gravatar.com avatars conditional?
- Loading Scripts on Specific Pages
- Condition function for is parent category?
- Conditional Statement – Best Way to Remove Nav on Contact Page
- Proper syntax for simple conditional bloginfo language
- Location-Based Content
- Personalized message for each unique password-protected page
- Conditional Shortcode image display
- Change Woocommerce order button page on particular page
- Change a url / link if a user is logged in?
- to create own conditional tags for business directory in wp
- How to use “Cases” instead of “IFs” for conditional logic
- Which is the better way to write a conditional statement? [closed]
- Nested conditionals
- Is there a way to password-protect part of a post?
- if/Else have_posts Else fails to echo message to page
- Conditonal statement for iPad
- Return function only on certain pages
- How to write this conditional statement?
- Conditional for Custom Post Types
- Date-Based Conditional Tag
- Message box when accessed from iPad
- Show this code if user has previously left a comment
- Insert a conditional in the middle of a function to give it 2 different outcomes
- How can I use ‘edit_form_after_title’ conditionally?
- Force Log in to view a page
- Conditional loading of CSS for my plugin
- Looks like this if condition is not working [closed]
- Generating images from an array of categories
- WP conditional site logo and header block
- How to know if the most recent article
- Widget logic conditional widget
- How to display image on condition that a selection has been made
- How to Conditionally Not Display a Link Based on Current URL?
- Allow users to only CREATE one single (custom) post
- If statement to check for post_content
- why is my custom loop failing?
- Conditional sidebar menu
- What is the best way to disable my WP website if the user has adblocker on? [closed]
- How do test if a post is a custom post type?
- Display several random posts, but make sure a condition is met
- Show content after the first and second paragraph
- How to display the_post_thumbnail if a post has one or otherwise display the first image in a post?
- Can shortcodes contain conditional statements? Even without them my shortcode renders blank page
- Display only certain posts based on visitor’s country?
- If function exists, and array is met, echo function?
- Conditional tag affecting taxonomy term and its children?
- Conditions for Users and Visitors
- Custom Menus, Widgets & Conditional Statements
- How to show my sidebar in specific page only?
- Query posts by content lenght
- Conditionally load child themes
- conditional statement for custom taxonomy
- BuddyPress User Profile Menu
- Add user settings to specific roles
- How to display conditional-content if wp_nav_menu( $args ) retruns something
- Create a new usermeta field for users
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- One custom loop with condition to check child posts
- Determine page content based on page parent
- Conditional Tags Based on Previously Viewed Posts
- Conditional based on number of specific custom taxonomy terms in archive.php
- How to conditionally hide author name on Single.php if category is “news”, otherwise if category is something else display author name?
- Conditional: IF current user has NOT commented on current post (not including post author)
- Display post if a specific tag is present
- Dynamic Sidebar Conditional [duplicate]
- Add class to DIV depending on page loaded
- If else with shortcodes
- Using PHP Increment and Conditional Statement to Alternate Loop Background
- Conditional statement not working in function
- How to hide a menu from public, but share content with a private link [closed]
- Condition within single.php to send an email to the post author
- do_action in conditional
- The conditional logic only works to show or hide?
- Conditionally remove comments and post meta in functions.php
- is_front_page breaks with url parameters generated by a plugin
- Checking for custom field in admin pages
- Conditionally run function based on custom meta value?
- Contact Form 7: conditional logic in e-mail
- Conditional formatting on data fetched from MYSQL
- Find and print first entry from WordPress post in custom excerpt?
- I’m trying to create an if statement that will only display my button link for tickets if its under ‘admission-event’… what is wrong with my code?
- How can I check the rewrite slug of current post type listing page
- Restrict content piece by role – Protection message in content?
- Conditional redirect on login using referring URL
- hide/show a div in wordpress
- Multiple domains, Single database, 1 Parent/Master with all content, other domains/slaves with filtered content (based on “location” variable)
- Conditional required fields for WordPress Contact Form 7
- Issue in If else condition [closed]
- Give a condition to a wordpress menu item to change its offerid for each landing page I create
- Help with if else statement for separating content from image attachment
- Checking conditionals
- Subpage Conditional