haltas
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Leaf] blog as front page but with a default template tab.Go to Settings->Reading. You should see it there.
Forum: Themes and Templates
In reply to: [Leaf] Older PostsThere are two ways:
Note: If you choose the first option, test it on a dummy-site first to see how it works for you. It is not necessary to create a child theme, because this is only html and css, no php, nothing in it will cause a crash, if pasted correctly. Update issue: Just save the lines below, so you can use them again after an update (If the basic structure doesn′t change).1st option: You create a new category as a parent of all of your current categories. Name it “Blog” or something like that. Then, go to home.php and put this between
<!-- End Articles. -->
and<?php endif; ?>
:<a href="https://www.yoursite.com/category/blog/page/3/" target="_self" style="text-decoration:none"> <div id="Oldones"> <span style="color:white"> <center>Older posts</center> </span> </div> </a>
Replace “yoursite.com” !
Set the number of articles shown in the slider to 3 in the slider section after “posts per page” ( near top of home.php ).
Be sure you have always set a post to “Featured”.
Have the homepage showing 10 posts for “newsfeed” in General Settings-> Reading (due to me using the german version of wordpress, I don′t know the exact terms of the interface) .
So, now you have 14 posts on the homepage, because of the “no duplicate” function.
That′s why the link above works with the 3rd page of your “Blog”-category.
You also have to set the number of posts on blog-pages to 7 (Settings -> reading).
Now the first two pages of archive-pages (including your parent-category) show each 7 posts on the first and second page, means the third page begins with the 15th post.Also, put this into your Custom Css box in Leaf Options:
#Oldones { position: absolute; background: #444; color: #fff; padding: 6px 9px 5px 9px; padding: .6rem .9rem .5rem .9rem; text-decoration: none; width: 100px; width: 10.0rem; right: 20px; right: 2.0rem; } #Oldones:hover { color: #fff; background-color: #accentcolor; }
Replace #accentcolor !
All that color-stuff will make that button look like the built-in pagination.
Now, when someone clicks that “Older posts”-button, that person will get to page 3 of all of your posts and the built-in pagination will display. But, if you go to page 1 of that Archive, you won′t get to the homepage again.Adding a Home-button on those pages:
Go to your archive.php .
Paste the following code between</div><!-- #content -->
and</section><!-- #primary .site-content .<?php echo leaf_grid_width( 'content' ); ?> .columns -->
:<a href="https://www.yoursite.com" target="_self" style="text-decoration:none"> <div id="homelink"> <span style="color:white"> <center>Home</center> </span> </div> </a>
Again, replace “yoursite.com”!
Paste this into your Custom Css Box in Leaf Options:#homelink { position: relative; background: #444; color: #fff; display: block; padding: 6px 9px 5px 9px; padding: .6rem .9rem .5rem .9rem; text-decoration: none; width: 100px; width: 10.0rem; left: 0; bottom: 8px; bottom: 0.8rem; z-index: 5000; } #homelink:hover { color: #fff; background-color: #accentcolor; }
Again, replace “#accentcolor”!
And have a div around the pagination like this:
<div id="mypagination"><?php leaf_pagination(); ?></div>
You only have to add<div id="mypagination">
and</div>
<?php leaf_pagination(); ?>
already exists!
Also paste this into that Custom Css Box:#mypagination { position: relative; bottom: 30px; bottom: 3.0rem; z-index: 5000; right: -20px; right: -2.0rem; }
This is a solution requiring a bit of mathematical understanding and effort, but comes along using solely html and css.
2nd Option:
This solution is way easier. But it won′t work perfectly.
Have a look at https://www.ads-software.com/support/topic/pagination-issue-10?replies=3Forum: Themes and Templates
In reply to: [Leaf] Slider image doesn't cropType this into your Custom CSS Box in Leaf Options:
.iviewSlider {background-position: center !important;}
Forum: Themes and Templates
In reply to: [Leaf] Slider image backgroundPut this into your Custom Css Box:
.iviewSlider {background-position: center !important;}
Forum: Themes and Templates
In reply to: [Leaf] adding social media icons to the headerCould you post your website′s url?
You have to set a featured image. This theme will not automatically grab an image out of a post. Except you go into theme-plugins.php and change this in the leaf_get_post_image function
function leaf_get_post_image($image_id = null, $post_id = null, $use_attachments = false, $url = null, $size = 'large')
to this
function leaf_get_post_image($image_id = null, $post_id = null, $use_attachments = true, $url = null, $size = 'large')
(‘false’ to ‘true’ right after ‘$use_attachments’)
And, by the way, if you delete images from your gallery, you should also get the references out of your posts.
Forum: Themes and Templates
In reply to: [Leaf] Slider pictures are incredibly zoomedSize the images to 720x318px or less if you don′t want them to be displayed cropped. It′s not about the scale, but the actual px. The slider won′t resize your images. So dismiss the images you′ve attached and re-size (px) them outside of wordpress. Then, upload the accordingly sized images and use them.
Forum: Themes and Templates
In reply to: [Leaf] How do i add breadcrumbI am using RDFa Breadcrumb (plugin) and call it in single.php like this:
<?php /** * The Template for displaying all single posts. * * @since Leaf 1.0 */ get_header(); ?> <div id="primary" class="site-content <?php echo leaf_grid_width( 'content' ); ?> columns"> <div id="content" role="main"> <center><?php if(function_exists('rdfa_breadcrumb')){ rdfa_breadcrumb(); } ?></center> <?php leaf_post_before(); // Before post hook. ?>
right before the ‘before post hook’
Forum: Themes and Templates
In reply to: [Leaf] Posts with No ImagesAnd that′s beyond my knowledge.
Forum: Themes and Templates
In reply to: [Leaf] Posts with No ImagesThat′s right, but it′s better than that “no image available”, isn′t it? You will have to write into your home.php and archive.php if you want to perform the exact adjustments you mentioned.
Forum: Themes and Templates
In reply to: [Leaf] Slider only will display one postjust had a look. Looks like it′s working well.
Forum: Themes and Templates
In reply to: [Leaf] Changing Font Color of Titles.post-home .entry-title and entry-header .entry-title are the parts responsible in the css. So you could type this into the custom css box:
.post-home .entry-title, .entry-header .entry-title { color: #yourcolor !important; }
I am not sure about this being correct, but you can give it a try.
Forum: Themes and Templates
In reply to: [Leaf] Posts with No Imagesgo into your ftp directory and replace the noimage.jpg (slider – 720×318) and noimagesmall.jpg (normal size) with something else named identically. It′s in …/themes/leaf/images .
Forum: Themes and Templates
In reply to: [Leaf] how to use pagination?this actually has been discussed. You can have a blog page where all of your posts are listed and you don′t need any additional plugins, because there is a function, called leaf_pagination, in this theme, which will display on any archive page if necessary (more than 10 posts in that archive by default).
Forum: Themes and Templates
In reply to: [Leaf] how to pull image out of post in leaf_get_post_imageI′ll be on that one. For the meantime you can use this:
Read carefully: If you don′t know how to work with your ftp-files, do none of the changes shown. Even if this code works for me, it can cause problems with your site you only can solve through ftp by replacing the changed code again with the original lines. Be sure you copy and save the original code before you do anything. Having a dummy site for testing is helpful when performing major changes like this.if (!function_exists('leaf_get_post_image')): function leaf_get_post_image($image_id = null, $post_id = null, $use_attachments = true, $url = null, $size = 'large') { global $id,$blog_id; $thumbnail_id = get_post_thumbnail_id(); $post_id = ( $post_id == null ) ? $id : $post_id; $attachment = array(); $category = get_the_category(); // If a URL is specified, use that. if ($url) return $url; // If image_id is specified, use that. elseif ($image_id) $attachment = wp_get_attachment_image_src( $image_id, $size ); // Check to see if NextGen Gallery is present. elseif(stripos($thumbnail_id,'ngg-') !== false && class_exists('nggdb')){ $nggImage = nggdb::find_image(str_replace('ngg-','',$thumbnail_id)); $attachment = array( $nggImage->imageURL, $nggImage->width, $nggImage->height ); } // If not, let's use the post's featured image. elseif ( has_post_thumbnail( $post_id) ) $attachment = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), $size ); // Otherwise, and only if we want to, just use the last image attached to the post. elseif ( $use_attachments == true ) { $images = get_children( array( 'post_parent' => $post_id, 'post_type' => 'attachment', 'numberposts' => 1, 'order' => 'ASC', 'post_mime_type' => 'image')); foreach($images as $image) { $attachment = wp_get_attachment_image_src( $image->ID, $size ); } } // If there is no image, use the default image (available filter: leaf_post_image_none). if (isset($attachment[0])) { $post_image_uri = $attachment[0]; } elseif ( 'slider' == $size ) { if (isset($category[1]->cat_name)) { $post_image_uri = apply_filters( 'leaf_slider_image_none', get_template_directory_uri() . '/images/' . $category[1]->cat_name . '.jpg' ); } elseif (empty($category[1]->cat_name)) { $post_image_uri = apply_filters( 'leaf_slider_image_none', get_template_directory_uri() . '/images/' . $category[0]->cat_name . '.jpg' ); } else { $post_image_uri = apply_filters( 'leaf_slider_image_none', get_template_directory_uri() . '/images/keinbild.jpg' ); } } else { if (isset($category[1]->cat_name)) { $post_image_uri = apply_filters( 'leaf_post_image_none', get_template_directory_uri() . '/images/' . $category[1]->cat_name . 'klein.jpg' ); } elseif (empty($category[1]->cat_name)) { $post_image_uri = apply_filters( 'leaf_post_image_none', get_template_directory_uri() . '/images/' . $category[0]->cat_name . 'klein.jpg' ); } else { $post_image_uri = apply_filters( 'leaf_post_image_none', get_template_directory_uri() . '/images/keinbildklein.jpg' ); } } // If no image, return now if ( $post_image_uri == apply_filters( 'leaf_slider_image_none', get_template_directory_uri() . '/images/no-image.jpg' ) || apply_filters( 'leaf_post_image_none', get_template_directory_uri() . '/images/no-image-small.jpg' ) ) return $post_image_uri; // If MU/MS install, we need to dig a little deeper and link through the blogs.dir. if ('IS_MU') { $imageParts = explode('/files/', $post_image_uri); if (isset($imageParts[1])) { $post_image_uri = '/blogs.dir/' . $blog_id . '/files/' . $imageParts[1]; } } return $post_image_uri; } endif;
Be sure you copy the original code before you paste this one into the theme-plugins.php, which you can edit within your wordpress admin view. If you want to use those lines including $category etc. you will have to put images into …/wp-content/themes/leaf/images via ftp named exactly after your categories(.jpg) for the slider (see
elseif ( 'slider' == $size ) { if (isset($category[1]->cat_name)) { $post_image_uri = apply_filters( 'leaf_slider_image_none', get_template_directory_uri() . '/images/' . $category[1]->cat_name . '.jpg' ); } elseif (empty($category[1]->cat_name)) { $post_image_uri = apply_filters( 'leaf_slider_image_none', get_template_directory_uri() . '/images/' . $category[0]->cat_name . '.jpg' ); } else { $post_image_uri = apply_filters( 'leaf_slider_image_none', get_template_directory_uri() . '/images/keinbild.jpg' ); }
)
or ‘categories-exact-name-here’klein.jpg for the thumbnails in this part:else { if (isset($category[1]->cat_name)) { $post_image_uri = apply_filters( 'leaf_post_image_none', get_template_directory_uri() . '/images/' . $category[1]->cat_name . 'klein.jpg' ); } elseif (empty($category[1]->cat_name)) { $post_image_uri = apply_filters( 'leaf_post_image_none', get_template_directory_uri() . '/images/' . $category[0]->cat_name . 'klein.jpg' ); } else { $post_image_uri = apply_filters( 'leaf_post_image_none', get_template_directory_uri() . '/images/keinbildklein.jpg' ); } }
Btw ‘klein’ (german) means small. Images’ sizes should be 720x320px for the slider and 300x200px (I′m not sure) for those named ‘categories-exact-name-here’klein.jpg . As you may notice, there also are ‘keinbild.jpg’ (means ‘noimage’) and ‘keinbildklein.jpg’, keinbild.jpg should be 720×320 and keinbildklein.jpg 300x200px. In case none of the category-images can be used, those will be shown. You could use your logo or something like that for them. Don′t forget to have those in your …/wp-content/themes/leaf/images , too. Maybe you are wondering why there is $category[0]->cat_name and $category[1]->cat_name . It has the function to take the second category linked to the post if there are more than one categories (e.g. sub-categories). $category[0]->cat_name is the first category and $category[1]->cat_name is the second. If there are any questions, ask them before doing anything ??