Forum Replies Created

Viewing 15 replies - 1 through 15 (of 59 total)
  • Thread Starter mYrAn

    (@myran)

    I don’t think your understanding me correctly phillbooth.. For each page, I want to have the exactly same content. In the sidebar of this page, I want to load the media files that has been attached to this page. When an administrator uploads a new file, they should have the abilitity to choose which user-role(s) this file should be visible to. Each page should be able to hold multiple files, and view the different files only for the user-role(s) that has been ticked of in the upload phase. The client in this case has different versions of the same documents based on which company their client is associated to.

    Thread Starter mYrAn

    (@myran)

    That is way to complex for a client to handle..

    Thread Starter mYrAn

    (@myran)

    Yes, that part is clear. But it still does not do anything about the attachment problem. I somehow need to be able to tell each attachment uploaded to each page that it should only be displayed to user-role X.

    Thread Starter mYrAn

    (@myran)

    Thanks, however this does not fix my “main problem” with having the attachment lists vary depending on which role/custom var the user has..

    Thread Starter mYrAn

    (@myran)

    Im not following you a 100%, but I don’t think that is what Im looking for. Thanks for the reply!

    Thread Starter mYrAn

    (@myran)

    What I need is basically something like the adminpart of this, for user-roles, and then some way of displaying the attachments for the page where the user-role is activated.

    Thread Starter mYrAn

    (@myran)

    I’ve solved it myself now, still not getting it 100% but it works at least.. There has got to be some smarter way of doing this, since im now looping trough all images for every term. Well, here’s the code (get posts grouped by term from custom taxonomy).

    <section id="content">
    	<?php
    	$categories = get_categories('taxonomy=year&order=DESC');
    
    	foreach($categories as $category) { ?>
    
    		<article class="year">
    			<h2><?php echo $category->name ?></h2>
    			<div class="items">
    			<?php
    			$args = array(
    				'post_type' => 'portfolio'
    			);
    
    			query_posts($args);
    			$count = 0;
    
    			while(have_posts()) : the_post();
    				$terms = get_the_terms( $post->ID, 'year' );
    
    				foreach ( $terms as $term ) {
    					$imgslug = $term->name;
    				}
    
    		 		if($imgslug == $category->name) {
    					if($count == 6) {
    						echo '<div class="expanded-items">';
    					}
    			?>
    					<div class="item">
    					<?php
    					$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full');
    					echo '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" rel="lightbox[' . $category->slug . ']" >';
    					the_post_thumbnail('thumbnail');
    					echo '</a>';
    					?>
    					</div>
    
    					<?php
    				}
    				$count++;
    
    			endwhile;
    			if($count >= 6) {
    				echo '</div>';
    			}
    			?>
    			</div>
    			<div class="expand">Visa fler</div>
    		</article>
    	<?php } ?>
    	</section>

    That is with an expandable list, so it shows 6 from the start and then expands to show the rest of the items (jQuery).

    Thread Starter mYrAn

    (@myran)

    Im just getting more and more confused by this.. Now I can get posts, from 2012 but not 2011 (????).

    $posts = get_posts('taxonomy=year&post_type=portfolio&year=' . $category->slug);

    Thread Starter mYrAn

    (@myran)

    Im now getting the categories, but no posts..

    <?php get_header(); ?>
    	<section id="content">
    	<?php
    	$categories = get_categories('taxonomy=year&order=DESC');
    
    	foreach($categories as $category) : ?>
    
    	<article class="year">
    		<h2><?php echo $category->name ?></h2>
    		<div class="items">
    		<?php
    		$args = array(
    			'category_name' => $category->slug,
    			'posts_per_page' => -1
    		);
    		query_posts($args) ?>
    		<?php
    		while(have_posts()) : the_post(); ?>
    
    		<div class="item">
    		<?php
    		$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full');
    		echo '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" rel="lightbox[' . $category->name . ']" >';
    		the_post_thumbnail('thumbnail');
    		echo '</a>';
    		?>
    		</div>
    		<?php endwhile; ?>
    		</div>
    	</article>
    	<?php
    	endforeach;
    	wp_reset_query();
    	?>
    </section>
    <?php get_footer(); ?>
    Thread Starter mYrAn

    (@myran)

    Nevermind this.. Why is it that when you think you’ve tried it all and ask for help you often solve it right away by yourself? Anyways, for people finding this thread in the future, use this:

    function short_design_tab($atts, $content = null) {
        extract( shortcode_atts( array(
            'titel' => 'default',
    	'bild' => '',
        ), $atts ) );
    
        return '
    	<div class="design-tab">
           	<h3>'. $titel .'</h3>
            <div class="tab-spacer"></div>
            <img src="' . get_template_directory_uri() . "/images/" . $bild .'" alt="" class="big-image" />
    		' . do_shortcode($content) . '
    	</div>';
    }
    Thread Starter mYrAn

    (@myran)

    Solved it myself!

    echo '
    <div class="news-item">
    <a href="';
    the_permalink();
    echo '" class="heavy">';
    the_title();
    echo '</a><p class="news-excerpt">';
    the_excerpt();
    echo '<span class="read-more"><a href="';
    the_permalink();
    echo '">Läs mer...</a></span></p></div>';
    Thread Starter mYrAn

    (@myran)

    Anyone? :<

    Thread Starter mYrAn

    (@myran)

    Bump..

    Thread Starter mYrAn

    (@myran)

    Ive managed to hide it the first time, but since a new box is added when ever i add a menubutton it just appears again..

    <script>
    jQuery(document).ready(function($) {
      $('input#custom-menu-item-url').attr('value', '#');
    });
    </script>
    Thread Starter mYrAn

    (@myran)

    I dont know that much jQuery. How do i change the value of #custom-menu-item-url to #? Hiding it isnt a problem, change the value is now.

Viewing 15 replies - 1 through 15 (of 59 total)