Forum Replies Created
-
AuthorPosts
-
csbeckMember
Here are some other options.
If you want to check if the user is logged in or not - http://codex.wordpress.org/Function_Reference/is_user_logged_in
If you want to check on what ability the user has - http://codex.wordpress.org/Function_Reference/current_user_can
Perhaps you can do this in sidebars? If you can then there's a pretty great plugin that lets you show or hide a particular widget based on the page (you can either check to show or hide the sidebar on a particular page - on my project, we created a primary sidebar with all of the widgets in it and modified what widget was visible on a page by selecting it or hiding it by selecting it - http://wordpress.org/plugins/display-widgets/.
Alternatively, you could also write some custom conditional code to show or hide particular sidebar widgets and base it on which template is used.
if ( is_page_template('about.php') ) { // Returns true when 'about.php' is being used. } else { // Returns false when 'about.php' is not being used. }
This is found in the WordPress Codex - http://codex.wordpress.org/Function_Reference/is_page_template
To make your code work in one of these functions though, it would need to be turned into a PHP function or shortcode - http://codex.wordpress.org/Shortcode_API
Another option might be to control it all with CSS. Depending on your child template, your BODY may have a class assigned to it when the user is logged in (logged-in). You could then create a CSS style with that class that points to that div and makes its DISPLAY: none. For instance:
.logged-in #inner #content-sidebar-wrap #sidebar .widget { display: none; }
Hopefully one of these will help.
Chris
csbeckMemberHave you tried using conditionals? So you could use something like this in your hook:
if ( is_home() ) { my_code_and_function...();
} else {
my_other_code_and_function...();
}If you'd like more case-by-case code help, you could include some code.
csbeckMemberStrange, thought I got it to work last night. Try this:
.socialmediaicons {
clear: both;
margin: 0 auto;
overvlow: hidden;
width: 165px;
}
.socialmedia {
display: inline;
float: left;
}csbeckMemberWhen going responsive, you need to watch out for the widths of div's.
While looking through your code, you have a setting for the footer to be 1100px. I didn't look long enough but I'm not sure if that's in the responsive section of your styles.css or not. If you don't have another width setting for your footer in the responsive setting, it will maintain that width.
Same goes for your inner div.
I found possible issues in these style definitions:
(I believe this one is your responsive section)
.archive-page, .content-sidebar #content, .content-sidebar-sidebar #content, .footer-widgets-1, .footer-widgets-2, .footer-widgets-3, .full-width-content #content, .goinggreen-landing #inner, .goinggreen-landing #inner .wrap, .menu-primary, .menu-secondary, .sidebar, .sidebar-content #content, .sidebar-content-sidebar #content, .sidebar-sidebar-content #content, #content-sidebar-wrap, #footer, #footer .creds, #footer .gototop, #footer-widgets, #footer-widgets .wrap, #header, #header ul.menu, #header .widget-area, #inner, #inner .wrap, #sidebar-alt, #title-area, #wrap {...}(again I believe in the responsive section)
#footer, #footer-widgets, #header, #inner {...}(I think this is in your main section of your styles.css file)
#inner {...}I would suggest editing your responsive section definitions of these styles to show no width. You might have to mess around with that setting as well as margin and padding.
Hopefully this helps you go down the road of fixing your issue though.
Chris
csbeckMemberHi Kristi,
You could try adding to your style below:
.header-image #title a {
background-size: 100%;
}Realize that you may still have to style your #header, .wrap, #title-area or something else to make sure it fits accurately.
I hope this helps.
Chris
csbeckMemberTry changing these styles to this in your responsive section in your styles.css file:
.socialmediaicons {
margin: 0 auto;
width: 100%;
}
.socialmedia {
display: inline;
}
csbeckMemberSounds great Brad. Thanks!
csbeckMemberThanks Ryan. I did visit that page and it was a bit vague on the syntax. I wasn't sure how to represent the key name and such.
So I tried another go at it. I was successful with the following:
`cat=2&orderby=meta_value&meta_key=last_name&order=ASC`
So this took my manually entered Custom Field values assigned to the key "last_name" and sorted them alphabetically (since they were alpha characters). Thanks for the link and nudge to try it again.
csbeckMemberDo you know if there's a way to add custom fields to the query argument. I've tried a few things and it's not working.
I thought I'd try:
`cat=2&orderby=meta_value&order=ASC`
But that didn't work.
What I have is a custom field with a key of "last_name" and posts have different values with respect to the last name of people (there's a collection of people in a people category, the post title is a name - First Middle Last). So the custom field with the person's last name is in there so I could list these people on a blog listing page but I want to sort them by their last name.
Or would it be better if I just created a custom Blog Listing page and created a custom loop?
Any thoughts?
csbeckMemberSee if this will help.
csbeckMemberYes it is what I want. What defaults are you referring to that I shouldn't change?
I think I've got it working correctly now. There was a style that was making the area a set height.
Thanks so much for you sticking with me through this!
csbeckMemberGetting close. I changed the action to say:
`add_action( 'genesis_after_post_title', 'wpsites_before_blog_widget', 5 );`
Now I just have to push the loop content down. I thought I'd use "display: block;" but that's not doing it. Any thoughts?
csbeckMemberThanks. I used your exact code and put in my id (69) and it shows up but above the title area still.
Perhaps this issue is being generated by me using the Genesis Simple Hooks. I needed to create a section for the title and subtitle (together) that needed to not affect the content location below. So I added a special div for the Title and Subtitles. So in the hooks I did the following:
`genesis_before_post_title`:
<div class="page-title-container">
`genesis_before_post_content`:
</div> <!-- end page-title-container -->So perhaps this might be messing with our attempt to add the widget below the title.
If I were to add some PHP code (your function from above) in that hook with the end div, what would the code be?
Also, just for my knowledge, what is the number "5" for in your code above? The earlier code had a "9".
csbeckMemberThanks. It disappeared.
So that didn't work. Bummer.
csbeckMemberAgency. Sorry for not including that.
csbeckMemberHey, Brad to the rescue again! And look, you put in the curly brackets! You're so kind.
This works like a charm - as expected - except it's not in the right place exactly. Can you help again by helping figure out what hook to put it in? I thought it should have been the before the loop as you did it, but the title of the page is coming within the loop. Strange. I must be making a mess of things.
Thanks so much for your continued support!
csbeckMemberBTW - the existing site used a plugin called "Yet Another Featured Posts Plugin" but I'm wondering if it can be done by just hooking a little bit of code.
csbeckMemberOh good, so they look good on all devices? Your last note seemed like it wasn't working. Glad to hear it. I just tried it on my iphone and it looks good.
Best of luck!
csbeckMemberYou're very welcome. Just curious, what devices doesn't it look good on?
May 31, 2013 at 3:26 pm in reply to: Add page and post specific content between title and content #43414csbeckMemberHey Brad,
One more item with this feature. When the code gets the content from the new field, it sanitizes it - strips off any html markup. I'd like to make it possible to add markup in that field. Can you help resolve that so any html code is viable? Or perhaps make the field have a wysiwyg editor and not have the field get sanitized?
I ultimately want to be able to stylize the text that is there with <p> (because I'll need to indent it more than the parent div) and possibly give some of the words tags like <strong> and <em>.
Thanks so much for your help!
Chris
-
AuthorPosts