How to add pagination in Astra theme - wordpress

I am using Astra wordpress theme and if there is more than 5 articles on page it should be bottom banner with 1- 2- 3 like pagination. For that i have tried with WP-PageNavi plugin but looking for right place to insert <?php wp_pagenavi(); ?>. Any idea about it ?or any work around ?

Check 2 things:
Wp-admin > Settings > Reading > Blog pages show at most. <= Make this 5 or less for your case.
If the above doesn't work can you try using the astra_number_pagination() method instead? As Astra says that this will output numbered pagination.
These methods should work ideally, if not let me know.

Related

Opening Wordpress Gallery from a link

Is it possible to open a wordpress gallery using an anchor tag so that the gallery appears on the same page in a lightbox? I cannot figure out how to do so. It seems like it should be such a simple thing to do but I have tried various plug ins and cannot work out a simple solution.
first, install this plugin
https://wordpress.org/plugins/anything-popup/
Then go to setting->anthing-pop there will be a shortcode http://awesomescreenshot.com/03561dd759
then click to edit it and put the [galley] shortcode
http://awesomescreenshot.com/09261ddfc0
http://awesomescreenshot.com/0ae61ddmb5
Now use the shortcode on click see screenshot
http://awesomescreenshot.com/0de61dej39
you can use the shortcode into post or page or in file like this
<?php echo do_shortcode('[AnythingPopup id="1"]'); ?>
thanks

woocommerce theme development without shortcodes

I was wondering if someone could help me out. I am developing a theme that uses woocommerce as the ecommerce solution. I know that there are predefined shortcodes that you can use but i was wondering if there was a way to actually implement woocommerce items in my php code as opposed to using shortcodes.
Thanks,
Try this:
https://wordpress.stackexchange.com/a/125286/60175
<?php echo do_shortcode('[product_page id="31"]'); ?>
And at the Shortcodes doc, I see
To find the Product ID, go to the Product > Edit screen and look in the URL for the postid= as shown below.
http://docs.woothemes.com/document/woocommerce-shortcodes/
Of course this still uses shortcodes (pretty slick), but in your PHP. The Wordpress framework must be available in your PHP page, which I think you do by including wp-load.php at the beginning.

Adding A Button Between post-content and Related Posts Thumbnail Plugin on WordPress

I am trying to add a button to my WordPress template. Basically, I have the post and then there is the Related Posts Thumbnails widget that appears. I want the button to go between the text of the post and the related posts thumbnail widget. The code in my 'Single Post' that contains all of this is as follows:
<div class="post-content">
<?php the_content(__('<em><strong>More:</strong> Read the rest of this entry...</em>', 'life-is-simple')); ?>
</div>
I know the Related Posts Thumbnails plugin falls within this code because it's at that place when I 'Inspect Element' on Google Chrome. I can't find how to edit the order of things within that div though. Any help would be greatly appreciated, thanks!
EDIT
Clarification: I am using the Life Is Simple WordPress theme although it has been custom editing quite a bit (mostly on the CSS side of things though).
That plugin is probably appending the output to the_content with a filter .
That means , that the output is being added to the_content automatically. it is a common behaviour.
You need to look at the pluginĀ“s admin interface to see if you can have an alternative way (I believe there is ) which is using a template tag. in that case, you should put the template tag after the div where the the_content() is .
EDIT I :
After a small dig, - in fact there is - you need to put
<?php get_related_posts_thumbnails(); ?>
Then the plugin should know by itself not to append to the_content.
For parameter passing, or if something is not working, go read their APi or help files.
You'll probably need to edit single.php or archive.php in your theme. If nothing is occuring there that looks familiar, it's probably using a loop. In which case you might find what you are looking for either in loop.php, loop-single.php, or loop-archive.php depending on what type of page you are on and how the theme was constructed. Add your button near where you find Read the rest of this entry...
With more information (such as what theme you are using), one might be able to help more as well.

WordPress--post only latest 1 or 2 or 3 posts on homepage

How do I just display the latest post on home (not the whole archive as wp does by default)?
And how can I influence that it has/not date, category, read more, etc?
WP manual does not explain this clearly. Or does it? If yes, please tell me where?
Thank you guys! And girls!
The new Wordpress Themes have child themes, it is a new way to organize and simplify upgrading themes, but it can be a pain because they are not as easy to modify as older themes. Anyway, there is the old way:
You can use the settings in the Administration Page to set your homepage to display only one post (Settings / Reading / Blog pages show at most -> 1 post). But if you want just your home to display one post, and decide you want your archives to display the basic 10 posts, you can edit your theme template to use this function:
<?php query_posts('posts_per_page=1'); ?>
Function Reference/query posts
http://codex.wordpress.org/Function_Reference/query_posts
To be sure no date or category is displayed, you also have to edit the template and remove the corresponding php code (in the loop, you should look for these functions:
<?php the_category(); ?>
<?php the_date(); ?>
Function Reference/the category
http://codex.wordpress.org/Function_Reference/the_category
Function Reference/the date
http://codex.wordpress.org/Function_Reference/the_date
To use the new way, you have to create a child theme to your theme, and override the loop by creating your own loop.
Chld Themes
http://codex.wordpress.org/Child_Themes

Wordpress - how to show just posts on main index

I have a Wordpress theme that I've been making 'my own' visually and can't seem to get the main content section to display regular posts only - instead of the boxes.
Does anyone know how I can change this without messing it up completely? I've tried stripping everything away and replacing with the 'display all posts loop' thing, but no go. I've tried adding a new page and setting that to show posts and such, but that didn't work either ... all it did was show the latest post.
Any ideas?
Thanks, Jennifer
It depends on what theme you are editing to make your own. If you were editing the default theme one way to do it would be to open index.php, define the template name with something like:
<?php
/*
Template Name: home
*/
?>
and then save it as home.php. In your admin Reading settings set that as your home page.
I am not sure what you mean by "boxes" but I assume you are not interested in the sidebar?
In this file there is one main loop running and it is set to retrieve only the latest post and a sidebar. It pulls in the title of that post : the_title(); the content : the_content(); and the sidebar get_sidebar();. What do you mean by "regular posts"? If you wanted the home page to pull a selection of latest posts you would create your own loop using WP_Query.. something like :
<?php $the_query = new WP_Query('cat=3&showposts=5');
while ($the_query->have_posts()) : $the_query->the_post();?>
Where you are interested in defining the category id (3) and the number of posts to show (5). You can read more on creating these kind of loops here
http://codex.wordpress.org/Template_Tags/query_posts
Good luck :)

Resources