0

At the moment on my portfolio page you can click on a portfolio item and a ajax container pops up. And in this container you can click on a button to go to the project and read more details.

BUT

I want to disable this ajax container and when you click on a single portfolio item it needs to go straight to the project item page with all the details on it etc.

Now have I been searching in all of the .php files and in the scripts but I just can't find the action when you click on a portfolio item and I'm not really sure with what I need to replace it when found. I hope someone could help me with this one.

Here is the code of the portfolio page:

<div id="portfolio-grid" class="clearfix">
<?php
        while ( $portfolio_query->have_posts() ) : $portfolio_query->the_post();        
        get_template_part( 'includes/entry', 'portfolio' );
    endwhile; 
    wp_reset_postdata(); 
?>
</div> <!-- end #portfolio-grid -->   

And here is the code of the Ajax container -I think-

function et_show_ajax_project(){
global $wp_embed;

$project_id = (int) $_POST['et_project_id'];

$portfolio_args = array(
    'post_type' => 'project',
    'p' => $project_id
);
$portfolio_query = new WP_Query( apply_filters( 'et_ajax_portfolio_args', $portfolio_args ) );
while ( $portfolio_query->have_posts() ) : $portfolio_query->the_post();
    global $post;
    $width = apply_filters( 'et_ajax_media_width', 600 );
    $height = apply_filters( 'et_ajax_media_height', 480 );

    $media = get_post_meta( $post->ID, '_et_used_images', true );
    echo '<div class="et_media">';
        if ( $media ){
            echo '<div class="flexslider"><ul class="slides">';
            foreach( (array) $media as $et_media ){
                echo '<li class="slide">';

                if ( is_numeric( $et_media ) ) {
                    $et_fullimage_array = wp_get_attachment_image_src( $et_media, 'full' );
                    if ( $et_fullimage_array ){
                        $et_fullimage = $et_fullimage_array[0];
                        echo '<img src="' . esc_url( et_new_thumb_resize( et_multisite_thumbnail($et_fullimage ), $width, $height, '', true ) ) . '" width="' . esc_attr( $width ) . '" height="' . esc_attr( $height ) . '" />';
                    }
                } else {
                    $video_embed = $wp_embed->shortcode( '', $et_media );

                    $video_embed = preg_replace('/<embed /','<embed wmode="transparent" ',$video_embed);
                    $video_embed = preg_replace('/<\/object>/','<param name="wmode" value="transparent" /></object>',$video_embed); 
                    $video_embed = preg_replace("/height=\"[0-9]*\"/", "height={$height}", $video_embed);
                    $video_embed = preg_replace("/width=\"[0-9]*\"/", "width={$width}", $video_embed);

                    echo $video_embed;                              
                }
                echo '</li>';
            }
            echo '</ul></div>';
        } else {
            $thumb = '';
            $classtext = '';
            $titletext = get_the_title();
            $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext,false,'Ajaximage');
            $thumb = $thumbnail["thumb"];
            echo '<a href="'. esc_url( get_permalink() ) . '">';
                print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext);
            echo '</a>';
        }
    echo '</div> <!-- end .et_media -->';

    echo    '<div class="et_media_description">' . 
                '<h2 class="title">' . '<a href="' . get_permalink() . '">' . get_the_title() . '</a>' . '</h2>' .
                truncate_post( 560, false );

    echo '</div> <!-- end .et_media_description -->';

    echo '<a class="more" href="' . get_permalink() . '">' . __( 'Meer info &raquo;', 'Flexible' ) . '</a>';
endwhile; 
wp_reset_postdata();

die();

}
You can see the page here: http://bit.ly/10BDVVf

Again thank you!

4

1 回答 1

0

这是通过 javascript 控制的/wp-content/themes/Flexible/js/custom.js。注释掉第 29-77 行,它将按预期链接(return false最后取消该标准导航),但请记住,如果您直接编辑主题并升级它,您的更改将被覆盖。

于 2013-05-16T23:54:33.587 回答