Title: mYrAn's Replies | WordPress.org

---

# mYrAn

  [  ](https://wordpress.org/support/users/myran/)

 *   [Profile](https://wordpress.org/support/users/myran/)
 *   [Topics Started](https://wordpress.org/support/users/myran/topics/)
 *   [Replies Created](https://wordpress.org/support/users/myran/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/myran/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/myran/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/myran/engagements/)
 *   [Favorites](https://wordpress.org/support/users/myran/favorites/)

 Search replies:

## Forum Replies Created

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

1 [2](https://wordpress.org/support/users/myran/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/myran/replies/page/3/?output_format=md) 
[4](https://wordpress.org/support/users/myran/replies/page/4/?output_format=md) 
[→](https://wordpress.org/support/users/myran/replies/page/2/?output_format=md)

 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Different attachment depending on user role?](https://wordpress.org/support/topic/different-attachment-depending-on-user-role/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/different-attachment-depending-on-user-role/#post-3674173)
 * 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.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Different attachment depending on user role?](https://wordpress.org/support/topic/different-attachment-depending-on-user-role/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/different-attachment-depending-on-user-role/#post-3674169)
 * That is way to complex for a client to handle..
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Different attachment depending on user role?](https://wordpress.org/support/topic/different-attachment-depending-on-user-role/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/different-attachment-depending-on-user-role/#post-3674166)
 * 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.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Different attachment depending on user role?](https://wordpress.org/support/topic/different-attachment-depending-on-user-role/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/different-attachment-depending-on-user-role/#post-3674162)
 * Thanks, however this does not fix my “main problem” with having the attachment
   lists vary depending on which role/custom var the user has..
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Different attachment depending on user role?](https://wordpress.org/support/topic/different-attachment-depending-on-user-role/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/different-attachment-depending-on-user-role/#post-3674155)
 * Im not following you a 100%, but I don’t think that is what Im looking for. Thanks
   for the reply!
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Different attachment depending on user role?](https://wordpress.org/support/topic/different-attachment-depending-on-user-role/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/different-attachment-depending-on-user-role/#post-3674147)
 * What I need is basically something like the adminpart of [this](http://wordpress.org/extend/plugins/media-categories-2/),
   for user-roles, and then some way of displaying the attachments for the page 
   where the user-role is activated.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Get custom post type posts by taxonomy category](https://wordpress.org/support/topic/get-custom-post-type-posts-by-taxonomy-category/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/get-custom-post-type-posts-by-taxonomy-category/#post-2903115)
 * 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).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Get custom post type posts by taxonomy category](https://wordpress.org/support/topic/get-custom-post-type-posts-by-taxonomy-category/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/get-custom-post-type-posts-by-taxonomy-category/#post-2903073)
 * 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);`
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Get custom post type posts by taxonomy category](https://wordpress.org/support/topic/get-custom-post-type-posts-by-taxonomy-category/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/get-custom-post-type-posts-by-taxonomy-category/#post-2903054)
 * 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(); ?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [bloginfo – template_dir in a shortcode?](https://wordpress.org/support/topic/bloginfo-template_dir-in-a-shortcode/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/bloginfo-template_dir-in-a-shortcode/#post-2578570)
 * 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>';
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Widget – running a WP_Query in it?](https://wordpress.org/support/topic/widget-running-a-wp_query-in-it/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/widget-running-a-wp_query-in-it/#post-2331348)
 * 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>';
       ```
   
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Nav-menus, "Hide" URL option for Custom links?](https://wordpress.org/support/topic/nav-menus-hide-url-option-for-custom-links/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/nav-menus-hide-url-option-for-custom-links/#post-2251755)
 * Anyone? :<
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Nav-menus, "Hide" URL option for Custom links?](https://wordpress.org/support/topic/nav-menus-hide-url-option-for-custom-links/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/nav-menus-hide-url-option-for-custom-links/#post-2251731)
 * Bump..
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Nav-menus, "Hide" URL option for Custom links?](https://wordpress.org/support/topic/nav-menus-hide-url-option-for-custom-links/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/nav-menus-hide-url-option-for-custom-links/#post-2251721)
 * 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>
       ```
   
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Nav-menus, "Hide" URL option for Custom links?](https://wordpress.org/support/topic/nav-menus-hide-url-option-for-custom-links/)
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/nav-menus-hide-url-option-for-custom-links/#post-2251720)
 * 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)

1 [2](https://wordpress.org/support/users/myran/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/myran/replies/page/3/?output_format=md) 
[4](https://wordpress.org/support/users/myran/replies/page/4/?output_format=md) 
[→](https://wordpress.org/support/users/myran/replies/page/2/?output_format=md)