Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Paul Thomson

    (@pthomson87)

    p.s. the following code is not working:

    function dfi_skip_page( $dfi_id ) {
            if ( is_page() ) {
                return 0; // invalid id
            }
            return $dfi_id; // the original featured image id
        }
        add_filter('dfi_thumbnail_id', 'dfi_skip_page' );
    Plugin Author janw.oostendorp

    (@janwoostendorp)

    Where did you put this code? I don’t have time to check it now. I’ll come back at you in 24 hours.

    Tnx for waiting

    Thread Starter Paul Thomson

    (@pthomson87)

    Hey, thanks for getting back to me, I put the code in the themes’ functions.php file…

    I look forward to your response shortly,
    Paul

    Plugin Author janw.oostendorp

    (@janwoostendorp)

    I’ve tested that code in a clean wordpress, it works. I think something might be something on your theme?

    A few questions:
    1. Do you have the code that displays the image?
    2. Are multiple pages show on the url where the problem occurs?
    3. If you run var_dump( is_page() ) in the functions.php does it return true where the problem occurs?
    4. Did you create the theme?

    If #3 returns false at the top then the page you are viewing isn’t a “real page”.

    Let me know!

    Plugin Author janw.oostendorp

    (@janwoostendorp)

    PS try:

    function dfi_skip_page( $dfi_id ) {
        if ( 'page' == get_post_type() ) {
            return 0; // invalid id
        }
        return $dfi_id; // the original featured image id
    }
    add_filter('dfi_thumbnail_id', 'dfi_skip_page' );

    This way you check the post_type not the theme template

    Thread Starter Paul Thomson

    (@pthomson87)

    Hello Jan,

    Thanks for your response and apologies for the delay in getting back to you.

    I can confirm that my page is in fact a page, I’ve also tried both snippets you have provided without any success.

    Only one page is displayed on the URL, you can see here for an example page: http://www.livefreedietravelling.com/terms-and-conditions/

    I’m using a theme called Sahifa, and as the theme developer states, there is no custom processing on featured images (http://themeforest.net/item/sahifa-responsive-wordpress-newsmagazineblog/discussion/2819356?page=153).

    If you are happy to provide an email address, I can email you the corresponding pages of the theme (if you are otherwise unable to get hold of it) for you to check over the code?

    Thanks again for all your help, it’s greatly appreciated.

    Paul

    Plugin Author janw.oostendorp

    (@janwoostendorp)

    Hi Paul,

    you can reach me as {my username}@gmail.com.
    I’m interested to see the code that doesn’t appear to workin full.
    I can take a look at it round this time tomorrow.

    Never mind, I thought my pages were pages but the are actually posts.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Disable on all Pages’ is closed to new replies.