Problem hat sich schon erledigt, trotzdem vielen Dank ;)
Beiträge von nature225
-
-
In welchem Zusammenhang?
Ist mir bei Wordpress o.Ä im Firefox noch nie begegnet eine Rechtsklicksperre.
-
PHP
Alles anzeigen<?php get_header(); ?> <?php // If Layout Type = Custom Pageif ( get_post_meta( get_the_ID(), 'minti_portfolio-detaillayout', true ) == "custom" ) { get_template_part( 'framework/inc/portfolio/custom' ); } else { ?> <div id="page-wrap" class="container portfolio-detail"> <div id="content"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php if ( get_post_meta( get_the_ID(), 'minti_portfolio-detaillayout', true ) == "wide" ) { get_template_part( 'framework/inc/portfolio/wide' ); } elseif ( get_post_meta( get_the_ID(), 'minti_portfolio-detaillayout', true ) == "wide-ns" ) { get_template_part( 'framework/inc/portfolio/wide-noslider' ); } elseif ( get_post_meta( get_the_ID(), 'minti_portfolio-detaillayout', true ) == "sidebyside" ) { get_template_part( 'framework/inc/portfolio/sidebyside' ); } elseif ( get_post_meta( get_the_ID(), 'minti_portfolio-detaillayout', true ) == "sidebyside-ns" ) { get_template_part( 'framework/inc/portfolio/sidebyside-noslider' ); } else { get_template_part( 'framework/inc/portfolio/wide' ); } ?> <div class="clear"></div> <?php if( get_post_meta( get_the_ID(), 'minti_portfolio-relatedposts', true ) == 1 ) { // Show related Posts Projects specific ?> <div id="portfolio-related-post" class="portfolio-default portfolio-overlay-icon clearfix"> <div class="sixteen columns"> <h3><?php _e('Related Projects', 'minti'); ?></h3> </div> <?php $terms = get_the_terms( $post->ID , 'portfolio_filter', 'string'); $term_ids = array_values( wp_list_pluck( $terms,'term_id' ) ); $second_query = new WP_Query( array( 'post_type' => 'portfolio', 'tax_query' => array( array( 'taxonomy' => 'portfolio_filter', 'field' => 'id', 'terms' => $term_ids, 'operator'=> 'IN' //Or 'AND' or 'NOT IN' )), 'posts_per_page' => 3, 'ignore_sticky_posts' => 1, 'orderby' => 'date', // 'rand' for random order 'post__not_in'=>array($post->ID) ) ); //Loop through posts and display... if($second_query->have_posts()) { while ($second_query->have_posts() ) : $second_query->the_post(); ?> <?php // LIGHTBOX if(get_post_meta( get_the_ID(), "minti_portfolio-lightbox", true ) == '1') { $portfoliolink = '<a href="'. esc_url(wp_get_attachment_url( get_post_thumbnail_id() )) .'" class="prettyPhoto" rel="prettyPhoto[portfolio]" title="'.esc_attr(get_the_title()).'">'; $lightboxicon = 'icon-minti-search'; } else { $portfoliolink = '<a href="'.esc_url(get_permalink()).'" title="'.esc_attr(get_the_title()).'">'; $lightboxicon = 'icon-minti-plus'; } ?> <?php // OVERLAY $overlay_output = '<div class="portfolio-overlay overlay-icon"></div><i class="'.esc_attr($lightboxicon).'"></i>'; ?> <?php // GET FEATURED IMAGE if ( has_post_thumbnail()) { $portfolio_thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'portfolio' ); } ?> <div class="portfolio-item one-third column"> <div class="portfolio-image"><?php echo $portfoliolink; ?><div class="portfolio-image-img"><img src="<?php echo esc_url($portfolio_thumbnail[0]); ?>" /></div><?php echo $overlay_output; ?></a></div> <h4><a href="<?php the_permalink(); ?>" title="<?php the_title() ?>"><?php the_title() ?></a></h4> <span class="portfolio-subtitle"><?php echo esc_html(get_post_meta( get_the_ID(), "minti_subtitle", true )); ?></span> </div> <?php endwhile; wp_reset_postdata(); ?> <?php } //end if have_posts() ?> </div> <!-- end of portfolio-related-posts --> <?php } //end related specific ?> <?php if($minti_data['switch_comments'] == 1) { ?> <?php if(comments_open()) { ?> <div class="sixteen columns portfolio-comments"><?php comments_template(); ?></div> <?php } ?> <?php } ?> <?php if($minti_data['switch_portfoliopagination'] == 1) { ?> <div id="post-navigation"> <!-- Navigation durch alle Portfolio Filters <?php previous_post_link('%link', '<div class="prev">%title</div>', false); ?> <?php next_post_link('%link', '<div class="next">%title</div>', false, ' ', 'portfolio_filter'); ?> --> <!-- Navigation nur durch Portfolio same Category --> <?php $prev_post = get_adjacent_post( true, '', true, 'portfolio_filter' ); ?> <?php if ( is_a( $prev_post, 'WP_Post' ) ) { ?> <div class="next"> <a href="<?php echo get_permalink( $prev_post->ID ); ?>"><?php echo get_the_title( $prev_post->ID ); ?> <i class="fa fa-chevron-right" aria-hidden="true"></i> </a> </div> <?php } ?> <?php $next_post = get_adjacent_post( true, '', false, 'portfolio_filter' ); ?> <?php if ( is_a( $next_post, 'WP_Post' ) ) { ?> <div class="prev"> <a href="<?php echo get_permalink( $next_post->ID ); ?>"><i class="fa fa-chevron-left" aria-hidden="true"></i> <?php echo get_the_title( $next_post->ID ); ?> </a> </div> <?php } ?> <!-- End Navigation --> <?php echo "<hr>"; $terms = get_terms( 'portfolio_filter' ); $count = count( $terms ); if ( $count > 0 ) { echo '<h3>Gesamt Portfolio Kategorien: '. $count . '</h3>'; echo '<ul>'; foreach ( $terms as $term ) { echo '<li>' . $term->name . '</li>'; } echo '</ul>'; } echo "<hr>"; ?> </div> <?php } ?> <?php endwhile; endif; ?> </div> <!-- end of content --> </div> <!-- end of page-wrap --> <?php } ?> <?php get_footer(); ?>Das ist meine single-portfolio.php
in Zeile 109 - Zeile 123 habe ich die Navigation, die NUR durch die selben Kategorien switscht.
-
[COLOR=#252C2F][FONT=Helvetica]Guten Morgen alle zusammen,[/FONT][/COLOR]
[COLOR=#252C2F][FONT=Helvetica]bin gerade dabei für Portfolios eine Navigation innerhalb der selben Kategorie zu programmieren.[/FONT][/COLOR]
[COLOR=#252C2F][FONT=Helvetica]Soweit klappt auch alles. Allerdings soll die Navigation, wenn die Kategorie "Pressemitteilungen" lautet nicht angezeigt werden[/FONT][/COLOR]
[COLOR=#252C2F][FONT=Helvetica]Mit untenstehenden Code lasse ich schoneinmal alle Portfolio Kategorien anzeigen, die existieren.[/FONT][/COLOR]
[COLOR=#252C2F][FONT=Helvetica][FONT=inherit]PHP-Code:[/FONT]
[FONT=Courier][FONT=inherit][COLOR=#0000BB][FONT=inherit]$terms [/FONT][/COLOR][COLOR=#007700][FONT=inherit]= [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]get_terms[/FONT][/COLOR][COLOR=#007700][FONT=inherit]( [/FONT][/COLOR][COLOR=#DD0000][FONT=inherit]'portfolio_filter' [/FONT][/COLOR][COLOR=#007700][FONT=inherit]);
[/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$count [/FONT][/COLOR][COLOR=#007700][FONT=inherit]= [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]count[/FONT][/COLOR][COLOR=#007700][FONT=inherit]( [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$terms [/FONT][/COLOR][COLOR=#007700][FONT=inherit]);
if ( [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$count [/FONT][/COLOR][COLOR=#007700][FONT=inherit]&[/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]gt[/FONT][/COLOR][COLOR=#007700][FONT=inherit]; [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]0 [/FONT][/COLOR][COLOR=#007700][FONT=inherit]) {
echo [/FONT][/COLOR][COLOR=#DD0000][FONT=inherit]'<h3>Gesamt Portfolio Kategorien: '[/FONT][/COLOR][COLOR=#007700][FONT=inherit]. [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$count [/FONT][/COLOR][COLOR=#007700][FONT=inherit]. [/FONT][/COLOR][COLOR=#DD0000][FONT=inherit]'</h3>'[/FONT][/COLOR][COLOR=#007700][FONT=inherit];
echo [/FONT][/COLOR][COLOR=#DD0000][FONT=inherit]'<ul>'[/FONT][/COLOR][COLOR=#007700][FONT=inherit];
foreach ( [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$terms [/FONT][/COLOR][COLOR=#007700][FONT=inherit]as [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$term [/FONT][/COLOR][COLOR=#007700][FONT=inherit]) {
echo [/FONT][/COLOR][COLOR=#DD0000][FONT=inherit]'<li>' [/FONT][/COLOR][COLOR=#007700][FONT=inherit]. [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$term[/FONT][/COLOR][COLOR=#007700][FONT=inherit]-&[/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]gt[/FONT][/COLOR][COLOR=#007700][FONT=inherit];[/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]name [/FONT][/COLOR][COLOR=#007700][FONT=inherit]. [/FONT][/COLOR][COLOR=#DD0000][FONT=inherit]'</li>'[/FONT][/COLOR][COLOR=#007700][FONT=inherit];
}
echo [/FONT][/COLOR][COLOR=#DD0000][FONT=inherit]'</ul>'[/FONT][/COLOR][COLOR=#007700][FONT=inherit];
}
[/FONT][/COLOR][/FONT][/FONT]
[/FONT][/COLOR]
[COLOR=#252C2F][FONT=Helvetica]Damit erstelle ich die Navigation:[/FONT][/COLOR][COLOR=#252C2F][FONT=Helvetica][FONT=inherit]PHP-Code:[/FONT]
[FONT=Courier][FONT=inherit] [COLOR=#0000BB][FONT=inherit]<?php [/FONT][/COLOR][COLOR=#007700][FONT=inherit]if ( [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]is_a[/FONT][/COLOR][COLOR=#007700][FONT=inherit]( [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$prev_post[/FONT][/COLOR][COLOR=#007700][FONT=inherit], [/FONT][/COLOR][COLOR=#DD0000][FONT=inherit]'WP_Post' [/FONT][/COLOR][COLOR=#007700][FONT=inherit]) ) { [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]?>
[/FONT][/COLOR] <div class="next">
<a href="[COLOR=#0000BB][FONT=inherit]<?php [/FONT][/COLOR][COLOR=#007700][FONT=inherit]echo [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]get_permalink[/FONT][/COLOR][COLOR=#007700][FONT=inherit]( [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$prev_post[/FONT][/COLOR][COLOR=#007700][FONT=inherit]->[/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]ID [/FONT][/COLOR][COLOR=#007700][FONT=inherit]); [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]?>[/FONT][/COLOR]">[COLOR=#0000BB][FONT=inherit]<?php [/FONT][/COLOR][COLOR=#007700][FONT=inherit]echo [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]get_the_title[/FONT][/COLOR][COLOR=#007700][FONT=inherit]( [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$prev_post[/FONT][/COLOR][COLOR=#007700][FONT=inherit]->[/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]ID [/FONT][/COLOR][COLOR=#007700][FONT=inherit]); [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]?>[/FONT][/COLOR] <i class="fa fa-chevron-right" aria-hidden="true"></i> </a>
</div>
[COLOR=#0000BB][FONT=inherit]<?php [/FONT][/COLOR][COLOR=#007700][FONT=inherit]} [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]?>
[/FONT][/COLOR]
[COLOR=#0000BB][FONT=inherit]<?php $next_post [/FONT][/COLOR][COLOR=#007700][FONT=inherit]= [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]get_adjacent_post[/FONT][/COLOR][COLOR=#007700][FONT=inherit]( [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]true[/FONT][/COLOR][COLOR=#007700][FONT=inherit], [/FONT][/COLOR][COLOR=#DD0000][FONT=inherit]''[/FONT][/COLOR][COLOR=#007700][FONT=inherit], [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]false[/FONT][/COLOR][COLOR=#007700][FONT=inherit], [/FONT][/COLOR][COLOR=#DD0000][FONT=inherit]'portfolio_filter' [/FONT][/COLOR][COLOR=#007700][FONT=inherit]); [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]?>
[/FONT][/COLOR] [COLOR=#0000BB][FONT=inherit]<?php [/FONT][/COLOR][COLOR=#007700][FONT=inherit]if ( [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]is_a[/FONT][/COLOR][COLOR=#007700][FONT=inherit]( [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$next_post[/FONT][/COLOR][COLOR=#007700][FONT=inherit], [/FONT][/COLOR][COLOR=#DD0000][FONT=inherit]'WP_Post' [/FONT][/COLOR][COLOR=#007700][FONT=inherit]) ) { [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]?>
[/FONT][/COLOR] <div class="prev">
<a href="[COLOR=#0000BB][FONT=inherit]<?php [/FONT][/COLOR][COLOR=#007700][FONT=inherit]echo [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]get_permalink[/FONT][/COLOR][COLOR=#007700][FONT=inherit]( [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$next_post[/FONT][/COLOR][COLOR=#007700][FONT=inherit]->[/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]ID [/FONT][/COLOR][COLOR=#007700][FONT=inherit]); [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]?>[/FONT][/COLOR]"><i class="fa fa-chevron-left" aria-hidden="true"></i> [COLOR=#0000BB][FONT=inherit]<?php [/FONT][/COLOR][COLOR=#007700][FONT=inherit]echo [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]get_the_title[/FONT][/COLOR][COLOR=#007700][FONT=inherit]( [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]$next_post[/FONT][/COLOR][COLOR=#007700][FONT=inherit]->[/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]ID [/FONT][/COLOR][COLOR=#007700][FONT=inherit]); [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]?>[/FONT][/COLOR] </a>
</div>
[COLOR=#0000BB][FONT=inherit]<?php [/FONT][/COLOR][COLOR=#007700][FONT=inherit]} [/FONT][/COLOR][COLOR=#0000BB][FONT=inherit]?>[/FONT][/COLOR] <!-- End Navigation -->[/FONT][/FONT]
[/FONT][/COLOR]
[COLOR=#252C2F][FONT=Helvetica]Hat jemand eine Idee, Vorschlag o.Ä. wie ich mein vorhaben umsetzen könnte?[/FONT][/COLOR][COLOR=#252C2F][FONT=Helvetica]Stehe gerade ziemlich auf den Schlauch.[/FONT][/COLOR]
[COLOR=#252C2F][FONT=Helvetica]Kurz zusammengefasst:[/FONT][/COLOR]
[COLOR=#252C2F][FONT=Helvetica]Navigation soll nicht angezeigt werden, wenn die Portfolio Kategorie == Pressemitteilungen ist. Ansonsten kann sie immer angezeigt werden,[/FONT][/COLOR]
[COLOR=#252C2F][FONT=Helvetica]Ich bedanke mich bei jedem für seine Hilfe [/FONT][/COLOR]:)