Add wp posts to cutom masonry grid
Instead of $count == 1 you should use ($count % 12) == 0, 1, and so on till 11. This gives back the remaining of the division. So if $count is 6 you would get 6, but if $count was 16 it would give back 4.
Instead of $count == 1 you should use ($count % 12) == 0, 1, and so on till 11. This gives back the remaining of the division. So if $count is 6 you would get 6, but if $count was 16 it would give back 4.
Help finding a plugin – masonry type post grid
This is not really a WordPress issue, you will have to play around with the CSS to get the layout you desire, if you take a look at isotope.js library you will see that hey have documentation on how to display Masonry grid https://isotope.metafizzy.co/layout-modes/masonry.html , and if that doesn’t fit your needs you can learn … Read more
It sounds like you need to use the pagination and posts_per_page arguments for your query. More info: http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters And using another solution to load more posts when the button is clicked. Maybe this will help you in the right direction.
Move the is_tax() conditional inside the slug_scripts_masonry function. function slug_scripts_masonry() { if ( is_tax() ) { wp_enqueue_script( ‘masonry’ ); wp_enqueue_style( ‘masonry’, get_template_directory_uri().’/css/’ ); } } add_action( ‘wp_enqueue_scripts’, ‘slug_scripts_masonry’ ); Because WordPress has not yet executed the code which determines the result of is_tax() it will return false on all pages.
This shouldn’t be a problem with Masonry, at least I never had one with it (or its similar equivalent Isotope). Actually it is just the beauty of those libraries that you are able to have this kind of layout. The rest comes down to the right CSS styles. I don’t know how you apply your … Read more
The answer is in your query itself $the_query = new WP_Query(“showposts=6&orderby=date”); showposts attribute is set to 6, change it to the number you prefer.
When I had this issue it was because I was missing something from the <head>. Below is the head from the basic template on the bootstrap website. <head> <meta charset=”utf-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1″> <!– The above 3 meta tags *must* come first in the head; any other head content must come … Read more
figured it out, turns out i was missing wp_footer() in my footer, once i added that i was able to solve my problem. thanks for the help
Do you know about JavaScript dependencies? If some JavaScript depends on another, it must be loaded after the dependencies. In your codepen you are loading JavaScripts in the correct order: jQuery Bootstap (depends on jQuery) Masonry (depends on jQuery) ccd-javsscript (depends on Masonry and jQuery) One the features of WordPress is the dependencies manager for … Read more