Hallo,
ich habe mir das Theme BizzBoss Pro gekauft und habe ein Problem mit dem Plugin/Widget Portfolio.
Nämlich: Portfolio verlinkt auf MeineSeite.de/portfolio/linkname ... wie bekomme ich den festen /portfolio/ Zwischenteil weg?
Habe mal in wp-content\themes\bizzbosspro\functions\pro-features\portfolio.php geschaut, ob sich dort was ändern lässt, aber verstehe nichts davon!
Hat jemand eine Idee, oder weiß, wo das eingestellt ist und wo man den festen portofolio-adressteil wegmachen kann?
PHP
<?php
function bizzboss_register_portfolio(){
register_widget( 'portfolio' );
}
add_action( 'widgets_init', 'bizzboss_register_portfolio');
class portfolio extends WP_Widget {
public function __construct() {
$widget_ops = array(
'class_name' => 'portfolio',
'description' => __('Awesome Portfolio Section', 'bizzboss')
);
parent::__construct( 'portfolio', 'Awesome Portfolio', $widget_ops );
}
/**
* Outputs the content of the widget
*
* @param array $args
* @param array $instance
*/
public function widget( $args, $instance ) {
echo $args['before_widget']; ?>
<div class="theme-container amazing-title">
<?php
$category_slug = $instance['category'];
$show_posts = $instance['num'];
if($instance['num'] != "")
{
$pq = new WP_Query('post_type=portfolio&portfolio_category='.$category_slug.'&posts_per_page='.$show_posts.'&order=DESC');
}
else
{
$pq = new WP_Query('post_type=portfolio&portfolio_category='.$category_slug.'&posts_per_page=3&order=DESC');
}
if( $pq->have_posts() ) :
while($pq->have_posts()) : $pq->the_post();
$url = wp_get_attachment_url( get_post_thumbnail_id( $pq->ID ) ); ?>
<?php if ( has_post_thumbnail() ) : ?>
<div class="col-md-4 col-sm-6 amazing-work">
<div class="effect">
<?php the_post_thumbnail( 'bizzboss-portfolio-image', array( 'alt' => get_the_title(), 'class' => 'img-responsive') ); ?>
<a href="<?php esc_url(the_permalink()); ?>">
<div class="caption-hover">
<h5><?php the_title(); ?></h5>
</div>
</a>
</div>
</div>
<?php endif; ?>
<?php
wp_reset_query();
endwhile;
endif; ?>
</div>
<?php echo $args['after_widget'];
}
/**
* Outputs the options form on admin
*
* @param array $instance The widget options
*/
public function form( $instance )
{
$category = ! empty( $instance['category'] ) ? $instance['category'] : '';
$num = ! empty( $instance['num'] ) ? $instance['num'] : ''; ?>
<style type="text/css">
#errmsg {
color: red;
}
</style>
<script type="text/javascript">
jQuery(".select-numpost").keypress(function (e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
jQuery("#errmsg").html("Digits Only").show().fadeOut("slow");
return false;
}
});
</script>
<p>
<label for="<?php echo esc_attr($this->get_field_id( 'category' )); ?>">
<?php _e( 'Select Category:', 'bizzboss' ); ?>
</label>
<select id="<?php echo esc_attr($this->get_field_id( 'category' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'category' )); ?>" class="widefat">
<?php
$terms = get_terms( 'portfolio_category' );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { ?>
<option value="" <?php selected ( $category, '' , true ); ?>>
<?php _e('All','bizzboss'); ?>
</option>
<?php foreach ( $terms as $term ) { ?>
<option value="<?php echo esc_attr($term->slug); ?>" <?php selected ( $category, $term->slug , true ); ?>>
<?php echo esc_html($term->name); ?>
</option>
<?php }
} ?>
</select>
</p>
<p>
<label for="<?php echo esc_attr($this->get_field_id( 'num' )); ?>">
<?php _e( 'Number Of Posts To show:', 'bizzboss' ); ?>
</label>
<input class="widefat select-numpost" id="<?php echo esc_attr($this->get_field_id( 'num' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'num' )); ?>" type="text" value="<?php echo esc_attr( $num ); ?>">
<span id="errmsg"></span>
</p>
<?php
}
/**
* Processing widget options on save
*
* @param array $new_instance The new options
* @param array $old_instance The previous options
*/
public function update( $new_instance, $old_instance ) {
$instance = array();
$instance['category'] = ( ! empty( $new_instance['category'] ) ) ? esc_html( $new_instance['category'] ) : '';
$instance['num'] = ( ! empty( $new_instance['num'] ) ) ? esc_html( $new_instance['num'] ) : '';
return $instance;
}
} ?>
Alles anzeigen