WordPress.org

Forums

Memoria Ticket System
Include style only on pages where form is available (2 posts)

  1. Olaf Lederer
    Member
    Posted 9 months ago #

    Hi,

    Nice plugin!
    I see you found some workaround for the image paths in default_style.css :)
    It would be great to have all these styles only on those pages where the shortcode (or the form is used). I use this check in my own contact form plugin:
    if( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'sts_memoria_ticket_system') ) {

    If you don't like to have the CSS code in your html, just include the css file with a php extension (quick and dirty) or use JavaScript to change the style for the images (together with wp_localize_script).

    Since you're from Sweden, I'm a bit surprised that your plugin is not ready for translations.

    https://wordpress.org/plugins/memoria-ticket-system/

  2. vatanbytyqi
    Member
    Plugin Author

    Posted 8 months ago #

    Hi,
    Sorry for the late reply.

    Thank you for your code sample. True, it is unnecessary to include the style on other pages even though it doesn't affect the other pages.

    I will make it ready for translation as well. Wanted to see what people thought about the core functions first therefore launching as early as possible.

Reply

You must log in to post.

About this Plugin

  • Memoria Ticket System
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic