• Resolved majkl85

    (@majkl85)


    Hi,

    this is a great and realy easy to use plug-in! However I would like to customize it’s front-end a bit, and therefore have a question – is it possible to include the modified view.php file at theme level, so the files don’t get overwritten after an update? If yes, what should be the folder structure inside my wp-content directory?

    Best regards,
    Michal

    • This topic was modified 4 years, 7 months ago by majkl85.
    • This topic was modified 4 years, 7 months ago by majkl85.
    • This topic was modified 4 years, 7 months ago by majkl85.
Viewing 1 replies (of 1 total)
  • Plugin Author Spiffy Plugins

    (@spiffyplugins)

    Interesting question. I came up with the following PHP snippet that could be added to functions.php. I ran it using the Code Snippets plugin, but you can choose to add it any way you like. This snippet replaces the calendar output function with a simple message.

    
    <?php
    add_action( 'plugins_loaded', 'spiffy_views_override' );
    
    function spiffy_views_override() {
    	global $spiffy_calendar_views;
    	
    	if (class_exists("SPIFFYCAL_Views")) {
    		class SPIFFYCAL_Views_Extended extends SPIFFYCAL_Views {
    	
    			// Main calendar output
    			function calendar($cat_list = '', $title = '') {
    				return "This is the calendar";
    			}
    		}
    		
    	    $spiffy_calendar_views = new SPIFFYCAL_Views_Extended;
    	}
    }
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Override views.php with custom theme’ is closed to new replies.