Title: dynamitharry's Replies | WordPress.org

---

# dynamitharry

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

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

 Search replies:

## Forum Replies Created

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

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

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Thematic vs Genesis](https://wordpress.org/support/topic/thematic-vs-genesis/)
 *  [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/thematic-vs-genesis/#post-2171607)
 * Hey,
 * When i have those kind of errors i usually that i messed up the code. Check to
   see that the code in functions ends with ?> And also, if you have any empty lines
   below the ?> remove them!
 * About thematic, I have used both and i have to say that thematic is ways better.
   You find everything you need in the forums and if you build a lot of web with
   thematic you can reuse the code so that you hardly have to write anything. Of
   course you can do this with Genesis. But Thematic is free and free is cool.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [limit page access by username](https://wordpress.org/support/topic/limit-page-access-by-username/)
 *  Thread Starter [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/limit-page-access-by-username/#post-2018672)
 * Ok, since i don’t get any responses here i have made my own solution that i gladly
   share.
 * First thing, i’m using Thematic with a child theme, and the plugin Magic Fields.
   But i guess that does not matter.
 * I have created two page templates. One called login and one called logged in 
   page.
 * The login page is the page where i login. It goes a bit backwards but but i take
   it from top to bottom anyway.
 *     ```
       <?php
       /**
        * Template Name: Custom Login Page
        *
        */
        //get the url from the current user
        	global $current_user;
             get_currentuserinfo();
             $address = $current_user->user_url;
             //when the page relodes direct the user to the user url address..
        if ( is_user_logged_in() ) { header( 'Location:' . $address ) ; } 
   
       wp_login_form();
       ```
   
 * When you visits it and is not logged in, you will see the form. when you log 
   in and the page reloads you will get directed to the your user url.
 * Then to the “logged in page”, you have to create this. Set a custom field to 
   have the same value as the user name. Then the code goes like this:
 *     ```
       //Check if the user is logged in
       	   global $current_user;
             get_currentuserinfo();
             //get the current username of the logged in user.
             $username = $current_user->user_login;
             // get the custom value user name of the page
       		 $user = get('restricted_to_user');
       		 //check if the username for the page and the username is the same. And always let the admin see the page..
        if (($username == $user) || (current_user_can('manage_options'))) {
       ```
   
 *  then go on the way you want with the page and in the end of the page:
 *     ```
       <?php } else {
   
          header( 'Location: http://localhost:8888/?page_id=XXX' ) ;
       }
       ?>
       ```
   
 * so that if you are not logged in you get directed to the login page.
 * This is quite manual, but still, i don’t have to mess with plugins, roles and
   stuff. It feels great.
 * If anyone have any doubts about this regarding security, searchbots or anything
   please tell me, because i don’t know much about it..
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [limit page access by username](https://wordpress.org/support/topic/limit-page-access-by-username/)
 *  Thread Starter [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/limit-page-access-by-username/#post-2018582)
 * I made some tests with custom fields. I set a name in a custom field in the page,
   the name of the user who should be able to see the page. Then i compare this 
   with the logged in user and also i make so the admin always can see the page.
 * Someone that has any thoughts about this and security. Is it a safe way of doing
   it?
 *     ```
       <?php global $current_user;
             get_currentuserinfo();
             $username = $current_user->user_login;
       		 $user = get('user_for_page');
        if (($username == $user) || (current_user_can('manage_options'))) { ?>
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form DB] [Plugin: Contact Form 7 to Database Extension] Invalid argument supplied for foreach() ExportToHtml.](https://wordpress.org/support/topic/plugin-contact-form-7-to-database-extension-invalid-argument-supplied-for-foreach-exporttohtmlphp-on-line-140/)
 *  Thread Starter [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-contact-form-7-to-database-extension-invalid-argument-supplied-for-foreach-exporttohtmlphp-on-line-140/#post-1996173)
 * Thanks!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [image gallery should show only the first image](https://wordpress.org/support/topic/image-gallery-should-show-only-the-first-image/)
 *  [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/image-gallery-should-show-only-the-first-image/#post-1271475)
 * Hey!
 * I’m also after the same thing! Did you do it?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Gd library](https://wordpress.org/support/topic/gd-library-2/)
 *  Thread Starter [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/gd-library-2/#post-1671029)
 * that is perfectly the answer to my questions! thanx!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [query post and navigation don't work](https://wordpress.org/support/topic/query-post-and-navigation-dont-work/)
 *  Thread Starter [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/query-post-and-navigation-dont-work/#post-1649551)
 * it works when i change in reading settings to only show one post, but that messes
   up my other category posts.. disturbing!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [query post and navigation don't work](https://wordpress.org/support/topic/query-post-and-navigation-dont-work/)
 *  Thread Starter [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/query-post-and-navigation-dont-work/#post-1649550)
 * i tried the code, it works to show only one post from category 9, but the navigation
   don’t work. is it something that is missing in my code?
 *     ```
       <?php
       /**
        * Template: Category.php
        *
        * @package WPFramework
        * @subpackage Template
        */
   
       get_header();
       ?>
   
       			<!--BEGIN #primary-->
       			<div id="primary" class="hfeed" >
   
       <?php
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       query_posts('cat=9&posts_per_page=1&paged=' . $paged);
       ?>
   
                   <?php if ( have_posts() ) : ?>
   
                       <h1 class="page-title archive-title">Category Archives: <span id="category-title"><?php single_cat_title(); ?></span></h1>
       <?php while ( have_posts() ) : the_post();  ?>
   
       				<div id="post-<?php the_ID(); ?>" class="<?php semantic_entries(); ?>">
       					<h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
   
       					<!--BEGIN .entry-meta .entry-header-->
       					<div class="entry-meta entry-header">
       						<span class="author vcard">Written by <?php printf( '<a class="url fn" href="' . get_author_posts_url( $authordata->ID, $authordata->user_nicename ) . '" title="' . sprintf( 'View all posts by %s', $authordata->display_name ) . '">' . get_the_author() . '</a>' ) ?></span>
       						<span class="published">on <abbr class="published-time" title="<?php the_time( get_option('date_format') .' - '. get_option('time_format') ); ?>"><?php the_time( get_option('date_format') ); ?></abbr></span>
       						<span class="meta-sep">&mdash;</span>
       						<span class="comment-count"><a href="<?php comments_link(); ?>"><?php comments_number( 'Leave a Comment', '1 Comment', '% Comments' ); ?></a></span>
       						<?php edit_post_link( 'edit', '<span class="edit-post">[', ']</span>' ); ?>
       					<!--END .entry-meta .entry-header-->
                           </div>
   
       					<!--BEGIN .entry-summary .article-->
       					<div class="entry-summary article">
       						<?php the_excerpt(); ?>
       					<!--END .entry-summary .article-->
       					</div>
   
       					<!--BEGIN .entry-meta .entry-footer-->
                           <div class="entry-meta entry-footer">
                           	<?php if ( framework_get_terms( 'cats' ) ) { ?>
                               <span class="entry-categories">Also posted in <?php echo framework_get_terms( 'cats' ); ?></span>
       						<?php } ?>
       						<?php if ( framework_get_terms( 'tags' ) ) { ?>
                               <?php if ( framework_get_terms( 'tags' ) and framework_get_terms( 'cats' ) ) { ?>
                               <span class="meta-sep">|</span>
       						<?php } ?>
                               <span class="entry-tags">Tagged <?php echo framework_get_terms( 'tags' ); ?></span>
                               <?php } ?>
       					<!--END .entry-meta .entry-footer-->
                           </div>
       				<!--END .hentry-->
       				</div>
   
       					 </li>
                 </ul>
   
       				<?php endwhile;  ?>
       				<?php include ( TEMPLATEPATH . '/navigation.php' ); ?>
       				<?php else : ?>
   
       				<!--BEGIN #post-0-->
       				<div id="post-0" class="<?php semantic_entries(); ?>">
       					<h2 class="entry-title">Not Found</h2>
   
       					<!--BEGIN .entry-content-->
       					<div class="entry-content">
       						<p>Sorry, but you are looking for something that isn't here.</p>
       						<?php get_search_form(); ?>
       					<!--END .entry-content-->
       					</div>
       				<!--END #post-0-->
       				</div>
   
       			<?php endif; ?>
       			<!--END #primary .hfeed-->
       			</div>
   
       <?php if (in_category(array(8, 18, 19, 20, 22, 9, 10, 11, 12))) { get_sidebar(); } else {} ?>
   
       <?php get_footer(); ?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [how an i echo just the id of an attachment?](https://wordpress.org/support/topic/how-an-i-echo-just-the-id-of-an-attachment/)
 *  Thread Starter [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/how-an-i-echo-just-the-id-of-an-attachment/#post-1638857)
 * Thanks!
 * But i dont think it works for me..
 * I list a lot of attachments from several post in my category.php.. every post
   got at least three attachments.. now when i put it in i just get the same attachment
   id on everything.
 * the reason why i need unique id’s is because i use [quicksand to filter my attachments..](http://razorjack.net/quicksand/)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [How to hide get_post_meta if there is no content there?](https://wordpress.org/support/topic/how-to-hide-get_post_meta-if-there-is-no-content-there/)
 *  Thread Starter [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/how-to-hide-get_post_meta-if-there-is-no-content-there/#post-1466220)
 * Was a bit too fast!
 * Found the solution here:
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Translate Theme My Login pt_BR](https://wordpress.org/support/topic/translate-theme-my-login-pt_br/)
 *  [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/translate-theme-my-login-pt_br/#post-1389420)
 * Bruno!
 * Could you explain a little bit more how you did this?
 * Can’t get it right..
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [images insted of words](https://wordpress.org/support/topic/images-insted-of-words/)
 *  Thread Starter [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/images-insted-of-words/#post-1407584)
 * thank you very much!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Client Login Gallery for photographers?](https://wordpress.org/support/topic/client-login-gallery-for-photographers/)
 *  [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/client-login-gallery-for-photographers/#post-1395447)
 * Well, i found one solution. Maybe not the best but i keep it in wordpress..
 * First i installed the plugin “Members”. Then i made it possible for everyone 
   to sign up to the blog. When they signed up i choosed in the members plugin that
   new people are pending with no access to special pages.
 * In my case there are different companys that will sign up so that they can write
   requests and order different stuff. So i created a page that i called login and
   that every company can see when logged in. I defined the settings in members.
   At the page wich every logged in user can see, a created a list of companys, 
   and there respective pages. And in member changed the access to them so that 
   the right person got access to them.
 * This is one way of doing it. It’s a bit manual (or very) but it works for me.
 * try it out!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [FormBuilder get_currentuserinfo](https://wordpress.org/support/topic/formbuilder-get_currentuserinfo/)
 *  Thread Starter [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/formbuilder-get_currentuserinfo/#post-1403367)
 * Cool, i’m gonna check it out!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [FormBuilder get_currentuserinfo](https://wordpress.org/support/topic/formbuilder-get_currentuserinfo/)
 *  Thread Starter [dynamitharry](https://wordpress.org/support/users/dynamitharry/)
 * (@dynamitharry)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/formbuilder-get_currentuserinfo/#post-1403317)
 * Thank you very much for the answer!
 * But i don’t get it to work. Do you use the FormBuilder plugin?
 * Where should i put this code? I try to put it in the value field. but it does
   not seems right to put this there, all i get in the e-mail that is sent to me
   is the whole code.
 * Can i put this in the page and then call something in the value field?
 * thank you!

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

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