Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Sicario

Members
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Sicario reacted to fisicx in Help me to add load more button in my category.php   
    It's because you are not formatting the query correctly:
    $query = new WP_Query( array( 'posts_per_page' => 5, 'cat' => 99 ) ); if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); //do something; } wp_reset_postdata(); } It's all detailed in the links I provided.
    Once you understand how the loop works you will discover a whole load of WP functions you can use.
  2. Like
    Sicario reacted to fisicx in Help me to add load more button in my category.php   
    That's a very complicated way to do this.
    If you just use a WP query you can set the category and limit the number of posts. You then just add the prev/next navigation.
    https://css-tricks.com/snippets/wordpress/run-loop-on-posts-of-specific-category/
    https://developer.wordpress.org/reference/functions/query_posts/
    Wordpress has done all the hard work for you - no need to reinvent the wheel.
  3. Like
    Sicario reacted to Jack in Help me to add load more button in my category.php   
    Your best bet here would be to do the whole lot using Javascript and avoid mixing PHP and JS together, otherwise it's going to be tricky to keep track of state of already loaded items. I think for this I would use the Wordpress API and pull out all posts under that category, then use posts per page and offset to change the items displayed https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/. Your load more will need to work out how many items are currently displayed and use that as your offset every time a new request is made.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.