Forum Replies Created

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

    (@atart)

    UPDATE.

    I started creating network and i used function switch_to_blog

    Query with posts works fine on page,
    but is it possible – to enter post inside second blog – not redirect to blog no. 1?

    I tried insted
    the_permalink();

    This function:
    get_blog_permalink(2);
    When i got link on blog no.2 but redirect like 404 error page.

    I make something wrong or this switch_to_blog don’t support that?

    • This reply was modified 9 years, 6 months ago by atart.
    Thread Starter atart

    (@atart)

    Hello,

    I didn’t started anything with this – just asking for tip before i start 🙂

    This function looks exatcly what i need. But it works good with custom post types and permalinks :)?

    Thank you for answer and tip!

    Thread Starter atart

    (@atart)

    It works!

    Thank you very much 🙂

    Thread Starter atart

    (@atart)

    I am stupid 😀
    I forgot about that:

    <?php echo do_shortcode("[woocommerce_social_media_share_buttons]"); ?>

    Thread Starter atart

    (@atart)

    I used php to solve my problem, it’s not good solution but it works.

    <?php $attachments = new Attachments( 'attachments' ); /* pass the instance name */ ?>
    			<?php if( $attachments->exist() ) : ?>
    			<?php while( $attachments->get() ) : ?>
    				<li>
    					<a href="<?php echo $attachments->url(); ?>" title="<?php echo $attachments->field( 'title' ); ?>">
    					<?php
    					$typ = $attachments->subtype();
    					if($typ == 'pdf'){
    						echo '<img src="'; bloginfo( 'template_url' ); echo'/content/products/pdf.png"  alt="" /><br />';
    					}
    					else if($typ == '3ds'){
    						echo '<img src="'; bloginfo( 'template_url' ); echo'/content/products/3ds.png"  alt="" /><br />';
    					}
    					else if($typ == 'dwg'){
    						echo '<img src="'; bloginfo( 'template_url' ); echo'/content/products/dwg.png"  alt="" /><br />';
    					}
    					?>
    					</a>
    					<a href="<?php echo $attachments->url(); ?>" title="<?php echo $attachments->field( 'title' ); ?>"><?php echo $attachments->field( 'title' ); ?><br /><?php echo $attachments->subtype(); ?></a>
    				</li>
    				<?php endwhile; ?>
    				<?php endif; ?>
Viewing 5 replies - 1 through 5 (of 5 total)