Wordpress寻求完整托管绝对链接而不是域的路径

时间:2013-03-04 16:28:58

标签: wordpress hosting broken-links

http://jakeruesink.com/hermes/bosweb/web166/b1664/ipg.jakeruesinkcom/wp-content/uploads/et_temp/designfeature-23171_240x240.jpg

这个链接显然是不正确的,但是如果你拿出“hermes / bosweb / web166 / b1664 / ipg.jakeruesinkcom /”那就可以了。出于某种原因,wordpress在http://jakeruesink.com/project-page/

上的这些图片的路径错误

以下是该页面的代码,但我不确定这是否需要修复。

<?php 
/*
Template Name: Filterable Portfolio
*/
?>
<?php get_header(); ?>

<?php get_template_part('includes/breadcrumbs', 'page'); ?>

<h1 class="page_title"><?php the_title(); ?></h1>

<div id="content-area" class="fullwidth clearfix">
<div class="post-content">
    <?php while ( have_posts() ) : the_post(); ?>
        <?php the_content(); ?>
        <?php wp_link_pages(array('before' => '<p><strong>'.esc_attr__('Pages','Flexible').':</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
        <?php edit_post_link(esc_attr__('Edit this page','Flexible')); ?>
    <?php endwhile; ?>
</div>  <!-- end .post-content -->
<?php
    $et_ptemplate_settings = array();
    $et_ptemplate_settings = get_post_meta($post->ID,'et_ptemplate_settings',true);
    $et_ptemplate_projectcats = isset( $et_ptemplate_settings['et_ptemplate_projectcats'] ) ? (array) $et_ptemplate_settings['et_ptemplate_projectcats'] : array();

    $portfolio_args = array(
        'post_type' => 'project',
        'showposts' => -1,
        'tax_query' => array(
            array(
                'taxonomy' => 'project_category',
                'field' => 'id',
                'terms' => $et_ptemplate_projectcats,
                'operator' => 'IN'
            )
        )
    );
    if ( empty( $et_ptemplate_projectcats ) )  unset ( $portfolio_args['tax_query'] );

    $portfolio_query = new WP_Query( apply_filters( 'et_home_portfolio_args', $portfolio_args ) );

    $categories = get_terms( 'project_category', array( 'include' => $et_ptemplate_projectcats ) );
    if ( $categories ){
        echo '<ul id="et_portfolio_sort_links">';
            echo '<li class="active">' . '<a href="#" data-categories_id="all">' . __( 'All', 'Flexible' ) . '</a>' . '</li>';
            foreach ( $categories as $category ){
                echo '<li>' . '<a href="#" data-categories_id="' . esc_attr( 'project_cat_' . $category->term_taxonomy_id ) . '">' . esc_html( $category->name ) . '</a>' . '</li>';
            }
        echo '</ul>';
    }
?>
<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 -->

这是投资组合页面的代码:

<?php 
/*
Template Name: Portfolio Page
*/
?>
<?php 
$et_ptemplate_settings = array();
$et_ptemplate_settings = maybe_unserialize( get_post_meta($post->ID,'et_ptemplate_settings',true) );

$fullwidth = true;
$et_ptemplate_showtitle = isset( $et_ptemplate_settings['et_ptemplate_showtitle'] ) ? (bool)       
$et_ptemplate_settings['et_ptemplate_showtitle'] : false;
$et_ptemplate_showdesc = isset( $et_ptemplate_settings['et_ptemplate_showdesc'] ) ? (bool)   
$et_ptemplate_settings['et_ptemplate_showdesc'] : false;
$et_ptemplate_detect_portrait = isset( $et_ptemplate_settings['et_ptemplate_detect_portrait'] ) ? (bool) 
$et_ptemplate_settings['et_ptemplate_detect_portrait'] : false;

$gallery_cats = isset( $et_ptemplate_settings['et_ptemplate_gallerycats'] ) ? (array)   
$et_ptemplate_settings['et_ptemplate_gallerycats'] : array();
$et_ptemplate_gallery_perpage = isset( $et_ptemplate_settings['et_ptemplate_gallery_perpage'] ) ? (int)  
$et_ptemplate_settings['et_ptemplate_gallery_perpage'] : 12;

$et_ptemplate_portfolio_size = isset( $et_ptemplate_settings['et_ptemplate_imagesize'] ) ? (int)  
$et_ptemplate_settings['et_ptemplate_imagesize'] : 2;

$et_ptemplate_portfolio_class = '';
if ( $et_ptemplate_portfolio_size == 1 ) $et_ptemplate_portfolio_class = ' et_portfolio_small';
if ( $et_ptemplate_portfolio_size == 3 ) $et_ptemplate_portfolio_class = ' et_portfolio_large';
?>

 <?php get_header(); ?>

<?php get_template_part('includes/breadcrumbs', 'page'); ?>

<div id="content-area" class="clearfix<?php if ( $fullwidth ) echo ' fullwidth'; ?>">
<div id="left-area">
    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>               
        <article id="post-<?php the_ID(); ?>" <?php post_class('entry clearfix'); ?>>
            <h1 class="page_title"><?php the_title(); ?></h1>

            <?php
                $thumb = '';
                $width = apply_filters('et_blog_image_width',640);
                $height = apply_filters('et_blog_image_height',320);
                $classtext = '';
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext,false,'Blogimage');
                $thumb = $thumbnail["thumb"];
            ?>
            <?php if ( '' != $thumb && 'on' == et_get_option('flexible_page_thumbnails') ) { ?>
                <div class="post-thumbnail">
                    <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>  
                </div>  <!-- end .post-thumbnail -->
            <?php } ?>

            <div class="post-content">
                <?php the_content(); ?>

                <div id="et_pt_portfolio_gallery" class="clearfix responsive<?php echo $et_ptemplate_portfolio_class; ?>">
                    <?php $gallery_query = '';
                    $portfolio_count = 1;
                    $et_open_row = false;
                    if ( !empty($gallery_cats) ) $gallery_query = '&cat=' . implode(",", $gallery_cats);
                    else echo '<!-- gallery category is not selected -->'; ?>
                    <?php 
                        global $wp_embed;
                        $et_videos_output = '';
                        $et_paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' );
                    ?>
                    <?php query_posts("showposts=$et_ptemplate_gallery_perpage&paged=" . $et_paged . $gallery_query); ?>
                    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

                        <?php $width = 260;
                        $height = 170;

                        if ( $et_ptemplate_portfolio_size == 1 ) {
                            $width = 140;
                            $height = 94;
                            $et_portrait_height = 170;
                        }
                        if ( $et_ptemplate_portfolio_size == 2 ) $et_portrait_height = 315;
                        if ( $et_ptemplate_portfolio_size == 3 ) {
                            $width = 430;
                            $height = 283;
                            $et_portrait_height = 860;
                        }                       

                        $et_auto_image_detection = false;
                        if ( has_post_thumbnail( $post->ID ) && $et_ptemplate_detect_portrait ) {
                            $wordpress_thumbnail = get_post( get_post_thumbnail_id($post->ID) );
                            $wordpress_thumbnail_url = $wordpress_thumbnail->guid;

                            if ( et_is_portrait($wordpress_thumbnail_url) ) $height = $et_portrait_height;
                        }

                        $titletext = get_the_title();
                        $et_portfolio_title = get_post_meta($post->ID,'et_portfolio_title',true) ? get_post_meta($post->ID,'et_portfolio_title',true) : get_the_title();
                        $et_videolink = get_post_meta($post->ID,'et_videolink',true) ? get_post_meta($post->ID,'et_videolink',true) : '';

                        if ( '' != $et_videolink ){
                            $et_video_id = 'et_video_post_' . $post->ID;
                            $et_videos_output .= '<div id="'. esc_attr( $et_video_id ) .'">' . $wp_embed->shortcode( '', $et_videolink ) . '</div>';
                        }

                        $thumbnail = get_thumbnail($width,$height,'',$titletext,$titletext,true,'et_portfolio');
                        $thumb = $thumbnail["thumb"];

                        if ( $et_ptemplate_detect_portrait && $thumbnail["use_timthumb"] && et_is_portrait($thumb) ) {
                            $height = $et_portrait_height;
                        } ?>

                        <?php if ( $portfolio_count == 1 || ( $et_ptemplate_portfolio_size == 2 && (!$fullwidth && ($portfolio_count+1) % 2 == 0) ) || ( $et_ptemplate_portfolio_size == 3 && (($portfolio_count+1) % 2 == 0) ) ) {
                            $et_open_row = true; ?>
                            <div class="et_pt_portfolio_row clearfix">
                        <?php } ?>

                                <div class="et_pt_portfolio_item">
                                    <?php if ($et_ptemplate_showtitle) { ?>
                                        <h2 class="et_pt_portfolio_title"><?php echo $et_portfolio_title; ?></h2>
                                    <?php } ?>
                                    <div class="et_pt_portfolio_entry<?php if ( $height == $et_portrait_height ) echo ' et_portrait_layout'; ?>">
                                        <div class="et_pt_portfolio_image<?php if ($et_videolink <> '') echo ' et_video'; ?>">
                                            <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, ''); ?>
                                            <span class="et_pt_portfolio_overlay"></span>

                                            <a class="et_portfolio_zoom_icon fancybox" title="<?php the_title(); ?>"<?php if ($et_videolink == '') echo ' rel="portfolio"'; ?> href="<?php if ($et_videolink <> '') echo esc_url( '#' . $et_video_id ); else echo($thumbnail['fullpath']); ?>"><?php esc_html_e('Zoom in','Flexible'); ?></a>
                                            <a class="et_portfolio_more_icon" href="<?php the_permalink(); ?>"><?php esc_html_e('Read more','Flexible'); ?></a>
                                        </div> <!-- end .et_pt_portfolio_image -->
                                    </div> <!-- end .et_pt_portfolio_entry -->
                                    <?php if ($et_ptemplate_showdesc) { ?>
                                        <p><?php truncate_post(90); ?></p>
                                    <?php } ?>
                                </div> <!-- end .et_pt_portfolio_item -->

                        <?php if ( ($et_ptemplate_portfolio_size == 2 && !$fullwidth && $portfolio_count % 2 == 0) || ( $et_ptemplate_portfolio_size == 3 && ($portfolio_count % 2 == 0) ) ) {
                            $et_open_row = false; ?>
                            </div> <!-- end .et_pt_portfolio_row -->
                        <?php } ?>

                        <?php if ( ($et_ptemplate_portfolio_size == 2 && $fullwidth && $portfolio_count % 3 == 0) || ($et_ptemplate_portfolio_size == 1 && !$fullwidth && $portfolio_count % 3 == 0) || ($et_ptemplate_portfolio_size == 1 && $fullwidth && $portfolio_count % 5 == 0) ) { ?>
                            </div> <!-- end .et_pt_portfolio_row -->
                            <div class="et_pt_portfolio_row clearfix">
                            <?php $et_open_row = true; ?>
                        <?php } ?>

                    <?php $portfolio_count++; 
                    endwhile; ?>
                        <?php if ( $et_open_row ) { 
                            $et_open_row = false; ?>
                            </div> <!-- end .et_pt_portfolio_row -->
                        <?php } ?>
                        <div class="page-nav clearfix">
                            <?php if (function_exists('wp_pagenavi')) { wp_pagenavi(); }
                            else { ?>
                                 <?php get_template_part('includes/navigation'); ?>
                            <?php } ?>
                        </div> <!-- end .entry -->
                    <?php else : ?>
                        <?php if ( $et_open_row ) { 
                            $et_open_row = false; ?>
                            </div> <!-- end .et_pt_portfolio_row -->
                        <?php } ?>
                        <?php get_template_part('includes/no-results'); ?>
                    <?php endif; wp_reset_query(); ?>

                    <?php if ( $et_open_row ) { 
                        $et_open_row = false; ?>
                        </div> <!-- end .et_pt_portfolio_row -->
                    <?php } ?>

                    <?php if ( '' != $et_videos_output ) echo '<div class="et_embedded_videos">' . $et_videos_output . '</div>'; ?>
                </div> <!-- end #et_pt_portfolio_gallery -->

                <?php wp_link_pages(array('before' => '<p><strong>'.esc_attr__('Pages','Flexible').':</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
                <?php edit_post_link(esc_attr__('Edit this page','Flexible')); ?>
            </div>  <!-- end .post-content -->
        </article> <!-- end .entry -->
    <?php endwhile; // end of the loop. ?>
</div> <!-- end #left_area -->

<?php if ( ! $fullwidth ) get_sidebar(); ?>
</div>  <!-- end #content-area -->

 <?php get_footer(); ?>

以下是entry.php的代码:

 <article id="post-<?php the_ID(); ?>" <?php post_class('entry clearfix'); ?>>
<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

<?php
    $thumb = '';
    $width = apply_filters('et_blog_image_width',640);
    $height = apply_filters('et_blog_image_height',320);
    $classtext = '';
    $titletext = get_the_title();
    $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext,false,'Blogimage');
    $thumb = $thumbnail["thumb"];
?>
<?php if ( '' != $thumb && 'on' == et_get_option('flexible_thumbnails_index') ) { ?>
    <div class="post-thumbnail">
        <a href="<?php the_permalink(); ?>">
            <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
        </a>    
    </div>  <!-- end .post-thumbnail -->
<?php } ?>

<div class="post-content">
    <?php 
        $index_postinfo = et_get_option('flexible_postinfo1');
        if ( $index_postinfo ){
            echo '<p class="meta-info">';
            et_postinfo_meta( $index_postinfo, et_get_option('flexible_date_format'), esc_html__('0 comments','Flexible'), esc_html__('1 comment','Flexible'), '% ' . esc_html__('comments','Flexible') );
            echo '</p>';
        }

        if ( 'on' == et_get_option('flexible_blog_style') ) the_content('');
        else echo '<p>' . truncate_post(360,false) . '</p>'; 
    ?>
    <a href="<?php the_permalink(); ?>" class="readmore"><?php esc_html_e( 'Read More', 'Flexible' ); ?></a>
</div>  <!-- end .post-content -->

0 个答案:

没有答案