Display Popup according to category

Hello Guys and thank you for your great Popup plugin !

I would like to know if it is possible to display a popup on all posts that belong in a category. For example if I have 40 posts in the category called "news", I would like all these 40 posts of this category to display the same popup. That would avoid me to copy past all the urls... Thank you very much !

  • Isaacx
    • WPMU DEV Initiate

    Hello Bojan,

    Actually I need a little more help (see my post above :grinning:

    My Custom Post Types belong to Custom Post Categories and Custom Post Tags, so I would like to know if it's possible to make it work as easily as for normal Categories.

    Thank you!

  • calvinrogercanas
    • New Recruit

    Hey Isaacx, hope you're well!

    You can achieve this by editing the file located at:
    /wp-content/plugins/popover/inc/rules/class-popup-rule-category.php

    Replace the code in line 55 - line 61 with this:

    $this->categories = get_terms(
    			array(
    				'category',
    				'your_custom_taxonomy'
    			),
    			array(
    				'hide_empty' => false,
    			),
    			'objects'
    		);

    Replace the "your_custom_taxonomy" with the name of your custom post category.

    Let me know if that helps! :slight_smile:

    Cheers!
    Calvin

  • Isaacx
    • WPMU DEV Initiate

    Hello Calvin and thanks for your help!

    I replaced the lines and this is now the good category that are displayed in the conditions of my popup.

    Nevertheless, my popup are not displaying on the posts matching to this category.

    Hope we'll figure out something

    Thanks a lot for your support, I really appreciate

    Isaac

  • calvinrogercanas
    • New Recruit

    Hey there Isaacx,

    Hope you're well!

    I will flag for our SLS staffs to gave their valuable input on this matter. Just want to tell you that our SLS staffs are awesome but may reply slower than normal since they solve complex threads. :slight_smile:

    Thanks for your patience on this one. :slight_smile:

    Best Regards,
    Calvin

  • Isaacx
    • WPMU DEV Initiate

    Hello Calvin,

    thank you for your answer. Please keep me posted as soon as you figured something out :slight_smile:

    A few months ago, I was using your add-on (but not the pro version though), and the popup was displaying in a different way.

    It seems that in the pro version, when the popup is displayed, the whole green is grey until you click to close the popup. Is it possible just to display to popup and let the surfer do whatever he wants on the website ? Because as it works now, when the popup displays, he has to close the popup to be able to navigate...

    Thank you,

    Isaac

    • Vinod Dalvi
      • WP Unicorn

      Hi Isaac,

      It seems that in the pro version, when the popup is displayed, the whole green is grey until you click to close the popup. Is it possible just to display to popup and let the surfer do whatever he wants on the website?

      You can allow users to scroll while PopUp is visible by checking the checkbox "Allow page to be scrolled while PopUp is visible" in the "Appearance" section as displayed in the attached screenshot.

      To allow users to do other things on your website while PopUp is visible, you have to develop some custom code to achieve it and also you will have to check the pop up option "Click on the background does not close PopUp." in the pop up Behavior section.

      Regards,
      Vinod Dalvi

  • Vinod Dalvi
    • WP Unicorn

    Hi Isaac,

    I have developed custom taxonomy pop up condition to display pop up on specific custom taxonomy pages.

    Just extract the attached file class-popup-rule-taxonomy.php and add it in the following pop up directory.

    popover/inc/rules/

    Then activate the pop up from the pop up settings page and configure it in the edit pop up screen.

    You have to add the following code in your wp-config.php file and change the custom_taxonomy_name to whatever taxonomy you are using.

    define("POP_UP_TAXONOMY", "custom_taxonomy_name");

    If you are having any problem using it then try using "Page Footer" pop up loading method.

    Let me know how it works for you.

    Best Regards,
    Vinod Dalvi

  • Isaacx
    • WPMU DEV Initiate

    Hello Vinod and thank you for your help.

    I will tell you how it works.

    As for my second question about letting the user navigate on my website with the popup displayed, isn't it possible to have this functionality back by adding or removing a code ? That would be perfect.

    Thanks,

    Isaac

  • Vinod Dalvi
    • WP Unicorn

    Hi Isaac,

    As for my second question about letting the user navigate on my website with

    the popup displayed, isn't it possible to have this functionality back by adding or removing a code ?

    I don't think it is possible without custom coding but i have notified the plugin developer to get his valuable reply here regarding this.

    He will reply here shortly.

    Regards,
    Vinod Dalvi

  • Philipp Stracker
    • The Crimson Coder

    Hi Isaac,

    by design all our PopUps are modal and need to be closed before the user can interact with the page - Exception: Scrolling can be enabled even when the PopUp is open...

    However, you actually can add some CSS to your theme/page to "position" the popup in a way that the user can interact with the page (click links, select text, fill out the comment form, etc)

    Do this:
    1. Activate the PopUp option "Use custom size" (+ set a width/height)
    2. Activate the PopUp option "Allow Page to be scrolled when PopUp is visible"
    3. Activate the PopUp option "Click on Background does not close PopUp"
    4. Add this CSS code to your theme (e.g. in header.php)

    <style>
    .wdpu-26 {
      /* make the modal background transparent */
      background: transparent !important;
    
      /* position the popup container*/
      left: auto !important;
      right: 20px !important;
      top: 60px !important;
      bottom: auto !important;
    
      width: 400px;  /*= custom width*/
      height: 300px;  /*= custom height*/
    
      /* set other visual options */
      position: absolute !important;
      padding: 0 !important;
      overflow: visible !important;
    }
    
    .wdpu-26 .wdpu-msg {
      top: 0px !important;
    }

    The CSS code above uses ".wdpu-26" in 2 places: This means that it will change the position of the PopUp with ID 26. Change "26" to any valid PopUp ID on your installation to make the code work.
    OR replace ".wdpu-26" with ".wdpu-container" to change all PopUps.

    Notice that you have to use "!important" with most CSS rules, otherwise the default PopUp styles are used!

    Let us know if these changes work for you - I have tested them on my installation and the PopUp was moved to the top/right corner while allowing visitors to interact with the page.

    Thanks for your feedback, Philipp :slight_smile:

  • Vinod Dalvi
    • WP Unicorn

    Hi Isaac,

    Do you have any update on my other issue ?

    (regarding creating popups according to a custom category taxonomy)

    I have posted the solution for it in my following reply which is now included in the latest version of pop up plugin so to use it just activate the 'Custom Taxonomies' pop up condition from the pop up settings.

    https://premium.wpmudev.org/forums/topic/display-popup-according-to-category#post-788333

    Please advise if you have more questions.

    Cheers,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.