My Graphene Slider [Full Picture Setup]
-
Well, I Wanted Full Pictures in Graphene Slider & No Borders!
http://xxx.yoursite.com/wp-admin/themes.php?page=graphene_options
Slider settings: (You need to setup/know some settings 🙂
Graphenes Slider Settings:– Make A Post Category for Graphene Slider.
– (Posts can be members of more than one Category)
– Number of Posts You want to Show in Slider.
– Slider display format : Background picture & excerpts
– Setup height of Slider/picture: >= 200px
Then to the Post :)– Insert Picture, eg. 660x200px in:
– Graphene post-specific settings: user defined picture: Your path
– Post excerpts: Write Just A few lines here for Slider picture.
– Add Post to Slider “Category”
CSS: Use Child-Theme: style.css or Graphene Custom CSS !!!Well, for the standard Graphene Slider, Borders, Colors & Wrap I now have these few lines:
.featured_slider{
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
margin-bottom: 2px;
}
.full-sized .slider-entry-wrap {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.4);
height: 100%;
position: absolute;
right: 0;
top: 0;
width: 35%;
}Fonts & Colors:
.full-sized .slider_post h2 a, .full-sized .slider_post h2 a:visited {
color: #AFAEAE;
font: 18px georgia;
}
.full-sized .slider_post_entry p {
color: #808080;
}Kim
Hi, Kim
This is great tips and is working really well.
Thanks for this.
One quick question I have is that, you know the slider contents come from post articles, meaning I have to have articles used for the slider images purpose only, which appears in the blog posts as well (of course), which is not cool…
Can we somehow hide those articles (ie, slider image purpose only articles) from blog thread?
Kind regards,
Admin
OK, there’s a few steps you need to take.
First, open up the theme’s
index.phpfile and insert this code just before the line that saysget_template_part('loop', 'index');:do_action('graphene_index_pre_loop');Make sure it’s the theme’s
index.phpfile. Don’t worry about losing the modification when you update the theme, as I’ll be including the code in the theme for the next update myself.Then, insert this code inside your child theme’s
functions.phpfile:/**
* Remove a certain category from the main loop
*/
function graphene_exclude_cat(){
if (is_home()){
global $wp_query, $query_string;
$cats = array(1); // The IDs of categories to be excluded
$args = wp_parse_args(array('category__not_in' => $cats, 'paged' => get_query_var('paged')), $query_string);
// Run the modified query
query_posts($args);
// Tell WordPress to set this is the home/blog page
$wp_query->is_home = true;
}
}
add_action('graphene_index_pre_loop', 'graphene_exclude_cat');Make sure you change the ID in this line:
$cats = array(1); // The IDs of categories to be excludedwith the ID of the category you wish to exclude.
Or you can also use the much easier (but not ideal) way: just change the published date of the slider posts to something very very long ago, so they’ll show up last in the blog posts list.
Thanks Syahir for prompt reply.
I followed your instruction but I guess my child functions.php is not working properly.
Now if I access my site, a text contents of functions.php briefly appears (for a sec or less) and then it goes to my site with the functions.php text appearing on top of my top page (above the header).
This is snippet of my index.php from graphene theme
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*/
do_action('graphene_index_pre_loop');
get_template_part('loop', 'index');
?>And (since I did not have funtions.php file in my child theme folder) I created it and copied and pasted what you instructed.
I left this part as is for the purpose of test.
$cats = array(1); // The IDs of categories to be excluded(category ID 1 is for ‘uncategorized’ category so it should have hidden that category…but no luck)
Sorry for being novice, but am I missing anything? how can I make my child’s functions.php work?
Kind regards,
Admin
Uh oh, I was under the impression that you already have a child functions.php.
Anyways, try adding
<?phpat the beginning of the child functions.php file, and?>at the end.
- You must be logged in to reply to this topic.
