<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>

		<title>Hiding a Row or Column by a User&#039;s Role &#8211; Themeco Community</title>
		<atom:link href="https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/feed/" rel="self" type="application/rss+xml" />
		<link>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/feed/</link>
		<description></description>
		<lastBuildDate>Sat, 18 Oct 2025 00:08:46 +0000</lastBuildDate>
		<generator>https://bbpress.org/?v=2.6.14</generator>
		<language>en-US</language>

		
														
					
				<item>
					<guid>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-218684</guid>
					<title><![CDATA[Hiding a Row or Column by a User&#039;s Role]]></title>
					<link>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-218684</link>
					<pubDate>Mon, 02 Mar 2015 20:38:34 +0000</pubDate>
					<dc:creator>harleyltd</dc:creator>

					<description>
						<![CDATA[
						<p>Is it possible to hide a row or column based on a user&#8217;s role? I can see that it is possible to use a class to hide a row but I am not savvy enough to know how to create a class to the functions.php file identifying a user role. <a href="http://codex.wordpress.org/Function_Reference/body_class#Add_Classes_By_Filters" rel="nofollow">http://codex.wordpress.org/Function_Reference/body_class#Add_Classes_By_Filters</a></p>
<p>If the user role is Subscriber or a unique role I added such as Hero, would you be willing to show me how to tweak this code to make it work?</p>
<pre><code>// Add specific CSS class by filter
add_filter( &#039;body_class&#039;, &#039;my_class_names&#039; );
function my_class_names( $classes ) {
	// add &#039;class-name&#039; to the $classes array
	$classes[] = &#039;class-name&#039;;
	// return the $classes array
	return $classes;
}</code></pre>
<p>Then I can add that class to the child css file and using it in the rows. PLEASE and thank you!</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-218827</guid>
					<title><![CDATA[Reply To: Hiding a Row or Column by a User&#039;s Role]]></title>
					<link>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-218827</link>
					<pubDate>Tue, 03 Mar 2015 00:43:26 +0000</pubDate>
					<dc:creator>harleyltd</dc:creator>

					<description>
						<![CDATA[
						<p>I had previously asked, via Themeforest comments, if it was possible to hide a row or column based on logged in/logged out. The response given did not work. It hid the whole age and not just the row. Here was the suggestion provided.</p>
<p>WordPress adds a class to the &lt;body&gt; element when a user is logged in that is (surprisingly enough) called logged-in. If you added a custom class to a Content Band such as:</p>
<p><code>[content_band class=&quot;my-class&quot;] ... [/content_band]</code></p>
<p>Then you could implement some CSS in your child theme like so to hide the band when logged in:</p>
<pre><code>.logged-in .my-class {
  display: none !important;
}</code></pre>
<p>I added the CSS and then added the class to the Content Band settings but it hid the whole page instead of just the row. What did I do wrong?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-218897</guid>
					<title><![CDATA[Reply To: Hiding a Row or Column by a User&#039;s Role]]></title>
					<link>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-218897</link>
					<pubDate>Tue, 03 Mar 2015 03:18:17 +0000</pubDate>
					<dc:creator>Rue Nel</dc:creator>

					<description>
						<![CDATA[
						<p>Hi There,</p>
<p>To add a custom class for logged in user, you can use this custom filter in your functions.php</p>
<pre><code>// Add specific CSS class by filter
add_filter( &#039;body_class&#039;, &#039;logged_user_roles&#039; );
function logged_user_roles( $classes ) {
  if ( is_user_logged_in() ) {
    $current_user = wp_get_current_user();
    // add &#039;logged-in-roles&#039; to the $classes array
    $classes[] = &#039;logged-in-&#039; . implode(&#039; logged-in-&#039;, $current_user-&gt;roles);
  }

  // return the $classes array
  return $classes;
}</code></pre>
<p>Make sure that you enclose your content for that user roles in a separate content band. </p>
<pre><code>[content_band] can be viewed by anyone [/content_band]
[content_band class=&quot;custom-class&quot;] Only for subscribers [/content_band]</code></pre>
<p>And in your css, you use this.</p>
<pre><code>.logged-in-subscriber .custom-class {
  display: none !important;
}</code></pre>
<p>Please let us know if this works for you.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-218921</guid>
					<title><![CDATA[Reply To: Hiding a Row or Column by a User&#039;s Role]]></title>
					<link>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-218921</link>
					<pubDate>Tue, 03 Mar 2015 03:53:17 +0000</pubDate>
					<dc:creator>harleyltd</dc:creator>

					<description>
						<![CDATA[
						<p>That worked great. Thank you!!!</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-218937</guid>
					<title><![CDATA[Reply To: Hiding a Row or Column by a User&#039;s Role]]></title>
					<link>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-218937</link>
					<pubDate>Tue, 03 Mar 2015 04:11:14 +0000</pubDate>
					<dc:creator>harleyltd</dc:creator>

					<description>
						<![CDATA[
						<p>Just realized that only fixed half the problem. I want to show one row/content band if the user is logged in and a different one if the visitor is logged out which means I need to create a version to display: none if they are logged out? I hate to be a bother but can you share the code to make this happen? This may be a cool option to go ahead and include in future releases. THANK YOU for all of your help.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-218957</guid>
					<title><![CDATA[Reply To: Hiding a Row or Column by a User&#039;s Role]]></title>
					<link>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-218957</link>
					<pubDate>Tue, 03 Mar 2015 05:11:36 +0000</pubDate>
					<dc:creator>Rue Nel</dc:creator>

					<description>
						<![CDATA[
						<p>Hi There,</p>
<p>Using our previous codes above, we could have something like this,</p>
<pre><code>[content_band class=&quot;logged-out&quot;] can be viewed by anyone [/content_band]
[content_band class=&quot;logged-in&quot;] Only for LOGGED IN subscribers [/content_band]</code></pre>
<p>And in your css, you use this,</p>
<pre><code>
.logged-out {
  display:block !important;
}

.logged-in {
  display: none !important;
}

.logged-in-subscriber .logged-out {
  display: none !important;
}

.logged-in-subscriber .logged-in {
  display: block !important;
}</code></pre>
<p>Please let us know if this works.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-219395</guid>
					<title><![CDATA[Reply To: Hiding a Row or Column by a User&#039;s Role]]></title>
					<link>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-219395</link>
					<pubDate>Tue, 03 Mar 2015 17:54:26 +0000</pubDate>
					<dc:creator>harleyltd</dc:creator>

					<description>
						<![CDATA[
						<p>If I only wanted to show a block to a logged in user, wouldn&#8217;t it be the opposite? logged-out = display:none and logged-in = display:block? If that is true, would the second half have stay the same or would it have to be reversed as well?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-219643</guid>
					<title><![CDATA[Reply To: Hiding a Row or Column by a User&#039;s Role]]></title>
					<link>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-219643</link>
					<pubDate>Tue, 03 Mar 2015 23:58:14 +0000</pubDate>
					<dc:creator>Rue Nel</dc:creator>

					<description>
						<![CDATA[
						<p>Hi There,</p>
<p>The first two set are the general setting which means that the public view of the boxes. The second set overrides the first set because the user has logged in. </p>
<p>Hope this make sense.</p>
<p>Thank you.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-219765</guid>
					<title><![CDATA[Reply To: Hiding a Row or Column by a User&#039;s Role]]></title>
					<link>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-219765</link>
					<pubDate>Wed, 04 Mar 2015 03:36:16 +0000</pubDate>
					<dc:creator>harleyltd</dc:creator>

					<description>
						<![CDATA[
						<p>Unfortunately, it doesn&#8217;t work. When I add that snippet to the custom css section under customize, the whole page disappears. Any other ideas? I&#8217;d love for this to work</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-219774</guid>
					<title><![CDATA[Reply To: Hiding a Row or Column by a User&#039;s Role]]></title>
					<link>https://theme.co/archive/forums/topic/hiding-a-row-or-column-by-a-users-role/#post-219774</link>
					<pubDate>Wed, 04 Mar 2015 03:53:34 +0000</pubDate>
					<dc:creator>Rue Nel</dc:creator>

					<description>
						<![CDATA[
						<p>Hi There,</p>
<p>Would you mind providing us the url of your site with login credentials, if necessary, so we can take a closer look? We need to check your custom functions and css.  To do this, you can make a post with the following info:</p>
<p>– Link to your site <br />
– WordPress Admin username / password (only if necessary)</p>
<p><strong>Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.</strong></p>
<p>Thank you.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

