Forum Replies Created
-
AuthorPosts
-
February 18, 2016 at 7:27 am in reply to: Show or Hide Author Box conditionally (based on post author) #179304myersbr2Member
I was able to get it figured out. Thanks to all who helped. Here's what I found. In my functions.php, I had:
//* Display author box on single posts
add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );This was keeping me from unchecking the box in the Users section of the wp-admin. I initially used Brad's statement to try and edit the rights, but quickly realized I could just remove the above statement entirely and the Users section Sandee mentioned would become editable again. Simple fix, just took me a while to get there...
Thanks to all!
February 16, 2016 at 10:45 am in reply to: Show or Hide Author Box conditionally (based on post author) #179149myersbr2MemberOkay, scratch that - it doesn't work...when I uncheck the box in the user profile and hit Update User, it re-checks it. Hmmm... It does the same thing for any user I try to make that change. Other boxes can be checked/unchecked.
February 16, 2016 at 10:00 am in reply to: Show or Hide Author Box conditionally (based on post author) #179143myersbr2MemberThat's such a SIMPLE solution...and it works! Thank you Sandee!
myersbr2MemberUpdate: I have used CSS to hide some of the widgets I don't want to display on small screens. I guess I could create additional widgets, place them in the updated page location for different screen sizes and then use CSS to selectively hide/display them based on screen size, but that seems very inefficient. Is there a better way?
November 7, 2014 at 10:52 am in reply to: How to Prevent Automatic Selection of Featured Image? #130813myersbr2MemberThanks Sheryl; this solution does work. Good advice. Sometimes I just want to be too much of a purist. 😉
November 7, 2014 at 10:10 am in reply to: How to Prevent Automatic Selection of Featured Image? #130805myersbr2MemberThis is a really old thread but it is the exact trouble I'm having. I don't the post to set a featured image for me if I don't choose one. I just want it to not show up at all unless I select a featured image. Decor randomly chooses an image for me if I don't set a featured image.
The plugin option is one way to go, but I'd really just like to update the functions.php code that controls this:
/** Add post image below post title */
add_action( 'genesis_after_post_title', 'decor_post_image' );
function decor_post_image() {
if ( is_page() ) return;
if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) {
printf( '<span class="post-date">%s</span>', get_permalink(), do_shortcode( '[post_date format="j"][post_date format="F Y"]' ), $image, the_title_attribute( 'echo=0' ) );
} else {
printf( '<div class="post-photo"><span class="post-date">%s</span></div>', do_shortcode( '[post_date format="j"][post_date format="F Y"]' ));
}
}myersbr2MemberStill unresolved. I gave up after trying everything I found online. I'd greatly appreciate some help!
myersbr2MemberI was able to get this working and it has remained functional for a couple of weeks now. Thanks to braddalton and others who gave me the input to make it happen!
Final code to make this work was (inserted in simple hooks, this code was specifically in genesis_Before:
<?php
if ( !is_user_logged_in() ) { ?><div id="skyscraper">
DIV CONTENT HERE
</div><?php }
?>It turned out that having someone logged in was the best approach to consider because only those users who register on the site (paid members) would be the only ones logging in. We don't have a "free" membership level so this solved it nicely.
myersbr2MemberI'm normally the guy who is usually ASKING questions about these things (in fact, Brad, you're helping me with an issue now!) but on this one I actually found a working solution that I like. Maybe it will help the two of you if you still want the solution.
I made it work on one of my sites (www.stacymakescents.com) by implementing this type of menu code (CSS+jquery) and one image:
Jquery in wp_head():
<script type="text/javascript">// <![CDATA[
jQuery(document).ready(function($){
/* prepend menu icon */
$('#nav').append('<div id="mobi-menu"></div>');/* toggle nav */
$("#mobi-menu").on("click", function(){
$("#menu-main-nav").slideToggle();
$(this).toggleClass("active");
});
});
// ]]></script>==============================================================================
And then CSS to style it the way I wan it to look:
/* Responsive Menu */
#menu-icon {
display: none;
visibility: hidden;
}
@media only screen and (max-width: 568px) {
#mobi-menu {
background-color: #879f32;
background: url("http://www.stacymakescents.com/wp-content/themes/decor/images/mobile-menu-icon.png") no-repeat scroll 0 0 transparent;
cursor: pointer;
display: block;
height: 30px;
margin: 0px;
width: 40px;
visibility: visible; }.menu-primary li ul {
margin: 0 0 0 15px;
}.menu-primary li, .menu-secondary li, #header .menu li, ul.sub-menu {
float: none;
}.genesis-nav-menu.menu-secondary a {
float: left;
line-height: 1px;
}.menu-secondary li, ul.sub-menu {
margin: 0 0 0 30px;
}#menu-main-nav {
display: none;
}
}/* Make sure main menu re-appears when scaled up */
@media only screen and (min-width: 569px) {#menu-main-nav {
display: block !important;
}
}You can see how it works to make one or two lines until you get below 568px, then goes to the iPhone looking mobile menu style. Your menu has so much padding, which looks good on desktop, so you might want to adjust that for those folks who would visit on iPad or smaller.
myersbr2MemberHere's the pastebin URL: http://pastebin.com/CtR4gVYy
THANK YOU for that. I can usually follow examples. ;0)
myersbr2MemberI'll play with this and see if I can come up with something. Thanks for the input! Ideally, I just want some of the hooks to "disappear" (content within them, at least) when the user is logged in. As a non-programmer, this one has been giving me fits.
myersbr2MemberOnly the last one is in a widget. The rest are in hooks I added through the Genesis Simple Hooks Plugin. The divs you reference are in the following hooks: genesis_before, genesis_after_content, genesis_after_post_content
myersbr2MemberBrad that is VERY generous! I'll take it...or any suggestions you have. Originally I didn't think it would matter if someone were logged in or not, as I'm using S2 member plugin to drive all the access restrictions. Instead, I thought it best to set a page template "member" for all members-only content when someone is logged in and so when the page template is "member", that's when they'd see a change in look/feel. If looking at whether or not someone is logged in is a better approach, I'm okay with it. Basically the difference in the member view vs. the non-member is that there are no ad divs on a member view and no sidebar. This would be fine on any/all pages for members or just those restricted as members-only content. I just want someone who is a member, when accessing member content, to definitely see a different view. Clear as mud?
Here's what I'm looking to change.
1. When a user is on the page_member.php page template (or when they are logged in as a member, if that's a better option), I want the following divs to not load:
#skyscraper, #lijit, #bottom-of-post-ad, .footer-widget-email-signup
Right now I've done this through CSS, but I've learned Google won't like that for adsense AND it will skew clickthrough numbers. I added the first three divs using the Simple Hooks plugin, and placed them in the following locations (in order, based on the divs above):
genesis_before, genesis_after_content, genesis_after_post_content
The .footer-widget-email-signup is a widget called (in the dashboard) footer 2. I'm not sure what it is in php.
2. I would like to default to the full content width design, which right now is defined as:
<body class="page page-id-33805 page-template page-template-page_member-php full-width-content">
example page: http://www.stacymakescents.com/membership-restricted-page-test
vs. with a standard page, the body is set up as:
<body class="page page-id-7434 page-template-default content-sidebar">
example page: http://www.stacymakescents.com/aboutme
Of course the page ID is irrelevant, but the rest is dictated by the page template and the selection I make within the page editor to choose the full-width-content.
myersbr2MemberWith our layout, sidebar options are out. 🙁
For now I'm using your suggestion of hiding using CSS. I'm not sure Google will be cool with that since I'm hiding adsense ads; I'll have to look into that. But for the meantime, it works. Thanks! If you (or anyone) has additional input, I'd prefer a way to make sure that when the page template is set as "member" these divs never load. Here's the code I ended up using:
.logged-in #skyscraper,
.logged-in #lijit,
.logged-in #bottom-of-post-ad,
.logged-in .footer-widget-email-signup {
display: none;
}myersbr2MemberHere's an example of the code I'm trying to hide on the member page template:
<div id="skyscraper">
<script type="text/javascript">
var width = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;google_ad_client = "ca-pub-xxxxxxxxx";
if (width > 729) {
// Load the 728x90 skyscraper Unit for wide screen
google_ad_slot = "0154784691";
google_ad_width = 728;
google_ad_height = 90;
} else if ((width < 729) && (width > 479)) {
// Load the 468x60 banner
google_ad_slot = "1187018676";
google_ad_width = 468;
google_ad_height = 60;
} else {
// For small screens, load the 320x50 small skyscraper
google_ad_slot = "4140485076";
google_ad_width = 320;
google_ad_height = 50;
}</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>myersbr2MemberThanks for your response csbeck. I initially thought a conditional would be a good solution, but I can't wrap my head around how to write the statements. I'm setting up pages for members only content and that content will have a different page template (without ads, for one). Can I write a conditional that says if everything except page template X show this code and if this one particular page template don't show it?
myersbr2MemberThanks for this plug-in solution! Works perfectly. And my previous post where I said simple, I definitely didn't mean "EASY". Simple and easy are rarely the same thing! 🙂
myersbr2MemberI'd really like to keep the URL as that is a legitimate plus for many of my commenters. Is there a way similar to the code you posted above that would add the checkbox instead of removing the URL field? Latham code looks simple enough in its functionality to remove a field. Sorry to be ignorant but I wonder why adding one should be any harder?
myersbr2MemberThanks, Brad. I'm going to try the Yoast SEO option to see if I can get that to work for me.
myersbr2MemberThanks, Brad, for some input.
Let me make sure I get this right - Log in to the old site, install the WP Migrate DB plugin and use it to export everything. That's now done and I have the sql database saved on my local machine.
Now what? I'm afraid to try to import that into the new WP install because I've got several new posts and comments since the transition on 3/9, so I'm wondering what happens if I try to import the database (and sadly, I'm not even sure how since I'm a total rookie with databases)? Won't it overwrite the new tags/categories/posts, etc., etc. I've created?
-
AuthorPosts