Forum Replies Created
-
AuthorPosts
-
October 3, 2014 at 6:23 am in reply to: Restrict access to custom post type on the front end. #126659jourdainMember
On second thoughts, I am going to be using genesis featured widget amplified to display the posts from the custom post type in a widget. Would it be easier to display the widget conditionally?
Basically I am creating a teacher support page but the content needs to be visible only when the user role is "Group Leader" or "admin". I can just remove the widget for anyone that is not a "Group Leader" or "admin", correct?
My code at the moment looks like
//* Register widget area for support page. genesis_register_sidebar( array( 'id' => 'new-widget', 'name' => __( 'Support Widget', 'domain' ), 'description' => __( 'Add Content Here', 'domain' ), ) ); add_action( 'genesis_entry_content', 'your_widget' ); function your_widget() { if ( is_page( 4825 ) and is_user_logged_in() && is_active_sidebar('new-widget') ) { genesis_widget_area( 'new-widget', array( 'before' => '<div class="new-widget widget-area">', 'after' => '</div>', ) ); } }
So my question is how to I display the widget conditionally based on user role? No doubt you have a tutorial already written for that. 🙂
Jourdain
jourdainMemberI have access to the magazine pro child theme, please could you give me some pointers as to transferring the blog page template to the genesis sample theme.
Thanks
jourdainMemberAlso, I need to remove the featured image link on the single post page. It currently just links to itself. I did have a look and search on your site for a code snippet. Please could you point me in the right direction.
http://www.tinygiant.chobhamhairstudio.com/whats-new/
Thanks again! Just to let you know I point people in the direction of your blog regularly. Thanks for the support.
Jourdain Coleman
jourdainMemberThanks for the dedicated post Brad I will try this when I get home. Do you have any suggestions for the formatting?
Cheers.
jourdainMemberI have managed to work it out 🙂
Thanks for your assistance.
Jourdain
jourdainMemberFirstly thanks for the response, much appreciated!
Is there anyway I could get it to look exactly like the recent post widget with the following:
- Image Size = 65px x 65pxThanks in advance, I have been pulling my hair out trying to achieve this.
Jourdain
jourdainMemberIf any one is interested I sorted this problem with the following code
//Offset bolg by 1 post add_action( 'pre_get_posts','child_change_home_query' ); function child_change_home_query( $query ) { if ( $query->is_main_query() and is_front_page() || is_archive() ) { $query->set( 'posts_per_page', '10' ); $query->set( 'offset', '1' ); } }
jourdainMemberThanks for the pointers Brad, I have it working now. 🙂
jourdainMemberI have tried playing around with the is_paged but to no avail. here is what the code currently looks like.
* Add widget support for homepage. If no widgets active, display the default loop. * */ function magazine_home_genesis_meta() { if ( is_active_sidebar( 'home-top' ) && ! is_paged()|| is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-bottom' ) ) { // Force content-sidebar layout setting add_filter( 'genesis_site_layout', '__genesis_return_content_sidebar' ); // Add magazine-home body class add_filter( 'body_class', 'magazine_body_class' ); // Remove the default Genesis loop remove_action( 'genesis_loop', 'genesis_do_loop' ); // Add homepage widgets add_action( 'genesis_loop', 'magazine_homepage_widgets' ); } }
I have tried different variations of is_paged but to no avail. ( I really should start learning PHP). If you could spare a little time for common newbie that be amazing!
Jourdain
jourdainMemberIn Settings > Reading I had "A static page" selected. I had to change it to "Your Latest Posts".
Such a simple solution. I am kicking myself.
Anyway, thanks again for investing your time brad I will be sure to have a little feature on my site to the people who helped me create it!
oh... I do have one last question. Can I remove the featured widget from page 2 of the home page? I have done it on all the other featured widgets but I am not to sure how to tackle this one.
You have helped me with this before, link: http://www.studiopress.community/topic/help-with-coding-magazine-pro/
Thanks again.
jourdainMembergenesis featured widget amplified de-active - If I deactivate the plugin then there is no pagination on the homepage. It will display the first 10 items then there will be no entries. The pagination numbers do not show up at the bottom of the page.
genesis featured widget amplified active - If I activate the plugin then the pagination shows at the bottom of the page but there is no functionality when page 2 or the next button is clicked.
I don't mind how I get there but I would like to have pagination active on the homepage. The first 10 entries to be displayed then 10 more on each of the pages clicked through.
thanks again for your help Brad
jourdainMemberIf I deactivate the plugin then there is no pagination.
jourdainMemberThanks for the suggestion, I have changed my original plan and added another widget that only displays on the home page (like you suggested.
Thanks again.
Jourdain
jourdainMemberSo if I add the widget area to the homepage, would I then use the text widget to add an image and tagline?
Also I will need to remove the widget are below a certain page width.
This all sound good to you?
Jourdain
jourdainMemberI have worked it out now. Link if you would like to see: http://creativefreaks.co.uk/
Jourdain
jourdainMemberThanks for your help, I now have the tagline displayed and the navigation
li
elements aligned where I would like them.I have a couple more questions, if you have any patience left:
1. When the menu item is hovered the background image will be removed/hidden. Is there a way to prevent this?
2. Also I would like to move the text (Home) over to the right so that it is not overlapping the background image. For some reason I can't find the correct selector and CSS. Having a dumb moment 🙂
Thanks again for your help with my customizations, it really is appreciated.
Jourdain
jourdainMemberI didn't use a plugin, I followed this tutorial http://designsbynickthegeek.com/tutorials/related-posts-genesis and then added some styling with CSS.
Hope this helps you.
jourdainMemberI'm am having trouble with the tagline. Please could you assist me with the CSS. Sorry be cheeky and keep asking 🙂
Jourdain
jourdainMemberAmazing, thanks for your help with all this. Just added the code you suggested to make the menu full width. I had to add a media query to make it look ok in the responsive design.
While we are on a roll with css I am also trying to get the top menu to look like the menu displayed on WordPress explorer.
Link: http://www.wpexplorer.com/So the Site title is displayed on the left with log and all other items on the right. Do you have any pointers?
Jourdain
jourdainMemberI have added the code like you mentioned, the code snippets are displayed below incase anyone else needs them in the future:
.site-title a{ display: none !important; }
.home .site-title { font-family: 'Raleway', sans-serif; font-size: 48px; line-height: 1; margin-bottom: 0; background: url(http://creativefreaks.co.uk/wp-content/uploads/2014/05/1140x400.gif) no-repeat !important; height: 400px; }
I do still have one problem in relation to the tagline text. If I code it the way you have suggested then where will I type the physical text. I'm not sure if I am being a total idiot or have missed your point.
Jourain
-
AuthorPosts