Skip to main content
fixed formatting
Source Link
cjbj
  • 15k
  • 16
  • 42
  • 89

Basically, I want my jQuery plugin to run only on article pages, that is, not on the home page, or other pages. Right now, I am doing this in the following way:

if ( is_single() ) {
    launchPlugin();
}

In other words, if the is_single()is_single() function returns true, I start my plugin. Am I doing it right? Is it universally acceptable for all wordpressWordPress blogs?

Basically, I want my jQuery plugin to run only on article pages, that is, not on the home page, or other pages. Right now, I am doing this in the following way:

if ( is_single() ) {
    launchPlugin();
}

In other words, if the is_single() function returns true, I start my plugin. Am I doing it right? Is it universally acceptable for all wordpress blogs?

Basically, I want my jQuery plugin to run only on article pages, that is, not on the home page, or other pages. Right now, I am doing this in the following way:

if ( is_single() ) {
    launchPlugin();
}

In other words, if the is_single() function returns true, I start my plugin. Am I doing it right? Is it universally acceptable for all WordPress blogs?

Source Link

How do I make sure that my plugin only runs on article detail pages?

Basically, I want my jQuery plugin to run only on article pages, that is, not on the home page, or other pages. Right now, I am doing this in the following way:

if ( is_single() ) {
    launchPlugin();
}

In other words, if the is_single() function returns true, I start my plugin. Am I doing it right? Is it universally acceptable for all wordpress blogs?