Sinds kort verdiep ik mij in websites en bouw ik mijn eigen website via Wordpress. Ik heb een theme met verschillende plugins geïnstalleerd. 1 van die plugins is een programma als een veiling etc.
Nu zit ik met een probleem. Als ik een nieuwe veiling aanmaak dan word er een standaard sjabloon gebruikt die niet mooi is. Ik heb gekeken in de files van de plugin en daar is er een php bestand met het gebruik van templates.
nu vraag ik jullie advies wat ik in dit php script moet veranderen om met een standaard template te werken voor elke veiling. dus met elke nieuwe deal/veiling moet hetzelfde template gebruikt worden
hieronder staat het php script
elke advies is welkom!
bijvoorbaat dank,
Robert
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Templates Functions
*
* Handles to manage templates of plugin
*
* @package Social Deals Engine
* @since 1.0.0
*
*/
/**
* Returns the path to the Deals templates directory
*
* @package Social Deals Engine
* @since 1.0.0
*/
function wps_deals_get_templates_dir() {
return apply_filters( 'wps_deals_template_dir', WPS_DEALS_DIR . '/includes/templates/' );
}
/**
* Get template part.
*
* @package Social Deals Engine
* @since 1.0.0
*/
function wps_deals_get_template_part( $slug, $name='' ) {
$template = '';
// Look in yourtheme/slug-name.php and yourtheme/deals-engine/slug-name.php
if ( $name )
$template = locate_template( array ( $slug.'-'.$name.'.php', wps_deals_get_templates_dir().$slug.'-'.$name.'.php' ) );
// Get default slug-name.php
if ( !$template && $name && file_exists( wps_deals_get_templates_dir().$slug.'-'.$name.'.php' ) )
$template = wps_deals_get_templates_dir().$slug.'-'.$name.'.php';
// If template file doesn't exist, look in yourtheme/slug.php and yourtheme/deals-engine/slug.php
if ( !$template )
$template = locate_template( array ( $slug.'.php', wps_deals_get_templates_dir().$slug.'.php' ) );
if ( $template )
load_template( $template, false );
}
/**
* Locate a template and return the path for inclusion.
*
* This is the load order:
*
* yourtheme / $template_path / $template_name
* yourtheme / $template_name
* $default_path / $template_name
*
* @package Social Deals Engine
* @since 1.0.0
*
*/
function wps_deals_locate_template( $template_name, $template_path = '', $default_path = '' ) {
if ( ! $template_path ) $template_path = WPS_DEALS_BASENAME . '/';//wps_deals_get_templates_dir();
if ( ! $default_path ) $default_path = wps_deals_get_templates_dir();
// Look within passed path within the theme - this is priority
$template = locate_template(
array(
trailingslashit( $template_path ) . $template_name,
$template_name
)
);
// Get default template
if ( ! $template )
$template = $default_path . $template_name;
// Return what we found
return apply_filters('wps_deals_locate_template', $template, $template_name, $template_path);
}
/**
* Get other templates (e.g. deals attributes) passing attributes and including the file.
*
* @package Social Deals Engine
* @since 1.0.0
*
*/
function wps_deals_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {
if ( $args && is_array($args) )
extract( $args );
$located = wps_deals_locate_template( $template_name, $template_path, $default_path );
do_action( 'wps_deals_before_template_part', $template_name, $template_path, $located, $args );
include( $located );
do_action( 'wps_deals_after_template_part', $template_name, $template_path, $located, $args );
}
?>