• Resolved danmellwood

    (@danmellwood)


    Hey Richie,

    I’m using multisite with MesoColumn. What I hope to do is use a few slider posts to link to other sites within my multisite network, but not completely change the post links.

    What I thought was to use the tag ids to provide the location of the site since I don’t use the tags for anything else. For example, there would be an if/else statement that says, “If there’s a tag, go to http://thesite.com/wordpress/tag/; else go to post” (just in PHP).

    If I knew PHP better, I’d knock this out myself, but I don’t, so I was hoping maybe you could help. Of course, I’m open to an easier solution, too. 🙂

    Thanks, Richie!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter danmellwood

    (@danmellwood)

    To maybe clarify a little more:

    The statement would work like this:

    If there’s a tag (the tag ID=’site-two’), then go to http://thesite.com/wordpress/site-two/; else go to post.

    Theme Author Richie KS

    (@rkcorp)

    this one a bit tricky but here goes…open lib/slider/jd-gallery-slider.php and add this to line 59

    $to_the_multisite = get_post_meta($post->ID,'to_the_multisite', true);

    then edit line 76 to this

    <?php
    if($to_the_multisite) { ?>
    <a href="<?php echo $to_the_multisite; ?>" title="<?php _e('Continue reading ', TEMPLATE_DOMAIN); ?><?php echo the_title_attribute(); ?>" class="open"></a>
    <?php } else { ?>
    <a href="<?php the_permalink(); ?>" title="<?php _e('Continue reading ', TEMPLATE_DOMAIN); ?><?php echo the_title_attribute(); ?>" class="open"></a>
    <?php } ?>

    now you can use custom field ‘to_the_multisite’ when edit/write post.

    key: to_the_multisite
    value: full url like hxxp://thesite.com/wordpress/site-two

    Thread Starter danmellwood

    (@danmellwood)

    Hey Richie, thanks for coming up with that for me!

    I installed the code where you directed me, but I’m not sure where to find the custom field “to_the_multisite”? Will that be in the SQL or should it be located within the WordPress Dashboard?

    Sorry that I haven’t figured it out. But I feel like this will work once I do!

    Thanks again!

    Thread Starter danmellwood

    (@danmellwood)

    I figured out the Custom Field thing on my own, but the code isn’t working for some reason.

    <?php
    $featured_on = get_theme_option('slider_on');
    $featured_category = get_theme_option('feat_cat');
    $featured_number = get_theme_option('feat_cat_count');
    $featured_post = get_theme_option('feat_post');
    ?>
    
    <?php if($featured_on == 'Enable'): ?>
    <?php if(!$featured_category && !$featured_post): ?>
    <?php else: ?>
    <?php if($featured_category): ?>
    
    <!-- GALLERY SLIDER START -->
    <div id="featuredbox">
    <div id="featured">
    <div id="Gallerybox">
    <div id="myGallery">
    <?php
    $query = new WP_Query( "cat=$featured_category&posts_per_page=$featured_number&orderby=date" );
    while ( $query->have_posts() ) : $query->the_post(); ?>
    <div class="imageElement post-<?php the_ID(); ?>">
    
    <?php
    $the_thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "featured-slider-img" );
    $thumbnail_src = $the_thumbnail_src[0];
    $check_thumb = strpos($thumbnail_src, '640x480');
    if( $check_thumb  ):
    echo dez_get_featured_slider_image("", "", 640, 480, "alignleft full", "featured-slider-img", dez_get_singular_cat('false') ,the_title_attribute('echo=0'), true);
    else:
    echo dez_get_featured_slider_image("", "", 640, 480, "alignleft full", "full", dez_get_singular_cat('false')  ,the_title_attribute('echo=0'), true);
    endif;
    ?>
    
    <h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php echo the_title(); ?></a></h3>
    <p><?php echo dez_get_custom_the_excerpt(30); ?></p>
    <a href="<?php the_permalink(); ?>" title="<?php _e('Continue reading ', TEMPLATE_DOMAIN); ?><?php echo the_title_attribute(); ?>" class="open"></a>
    </div>
    <?php endwhile; wp_reset_query(); ?>
    </div><!-- MYGALLERY END -->
    </div><!-- GALLERBOX END -->
    </div><!-- FEATURED END -->
    </div>
    <!-- GALLERY SLIDER END -->
    
    <?php elseif($featured_post && !$featured_category): ?>
    
    <!-- GALLERY SLIDER START -->
    <div id="featuredbox">
    <div id="featured">
    <div id="Gallerybox">
    <div id="myGallery">
    <?php
    query_posts( array( 'post__in' => explode(',', $featured_post), 'post_type'=> array('post', 'page', 'product', 'portfolio'), 'posts_per_page' => 100, 'ignore_sticky_posts' => 1, 'orderby' => 'date', 'order' => 'DESC' ) );
    while ( have_posts() ) : the_post();
    $post_regular_price = get_post_meta($post->ID,'_regular_price', true);
    if( function_exists('get_woocommerce_currency_symbol') ){
    $woo_cur_symbol = get_woocommerce_currency_symbol();
    $to_the_multisite = get_post_meta($post->ID,'to_the_multisite', true);}
    ?>
    <div class="imageElement post-<?php the_ID(); ?>">
    
    <?php
    $the_thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "featured-slider-img" );
    $thumbnail_src = $the_thumbnail_src[0];
    $check_thumb = strpos($thumbnail_src, '640x480');
    if( $check_thumb  ):
    echo dez_get_featured_slider_image("", "", 640, 480, "alignleft full", "featured-slider-img", dez_get_singular_cat('false') ,the_title_attribute('echo=0'), true);
    else:
    echo dez_get_featured_slider_image("", "", 640, 480, "alignleft full", "full", dez_get_singular_cat('false')  ,the_title_attribute('echo=0'), true);
    endif;
    ?>
    
    <h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php echo the_title(); ?></a><?php if($post_regular_price) { ?><?php echo '<span class="pricebox">'. $woo_cur_symbol . $post_regular_price . '</span>'; ?><?php } ?></h3>
    <p><?php echo dez_get_custom_the_excerpt(30); ?></p>
    <?php
    if($to_the_multisite) { ?>
    <a href="<?php echo $to_the_multisite; ?>" title="<?php _e('Continue reading ', TEMPLATE_DOMAIN); ?><?php echo the_title_attribute(); ?>" class="open"></a>
    <?php } else { ?>
    <a href="<?php the_permalink(); ?>" title="<?php _e('Continue reading ', TEMPLATE_DOMAIN); ?><?php echo the_title_attribute(); ?>" class="open"></a>
    <?php } ?>
    <?php endwhile; wp_reset_query(); ?>
    </div><!-- MYGALLERY END -->
    </div><!-- GALLERBOX END -->
    </div><!-- FEATURED END -->
    </div>
    <!-- GALLERY SLIDER END -->
    
    <?php endif; ?>
    
    <?php endif; ?>
    
    <?php endif; ?>
    Thread Starter danmellwood

    (@danmellwood)

    GOT IT! The new code actually needed to go in the top half of the code. But it works now and you definitely pointed me in the right direction! This is pretty great and it’s a huge relief. Thanks, Richie!!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Changing Slider Links’ is closed to new replies.