got it working now…
I added a counter
$i = 0;
$childnum = count($children);
just after the if statement of the children. & added this code
if ($i == $childnum - 1) {
$output .= '<div class="viewmore">'. $viewmore .'</div>';
}
$i++;
after the the code:
$output .= '<div style="clear:both;"></div></div>';
…Thanks again.. 🙂
Related Posts:
- List all posts with the parent or grandparent of a page with a specified ID
- Check if is on child-page of a particular page
- A check for if is parent page, if has children, if has grandchildren
- Can I have two child pages of different parents with the same name?
- Create a “Dummy” parent page for a hierarchy in page listing?
- Allow only new sub-pages to be created
- Is there a default template file for child pages / subpages?
- Get Permalink for the top level parent of child pages
- How to embed page content in a blog post
- Some pages are missing from the Parent Page select in the Editor
- How to display list of child pages of parent page in wordpress?
- Only allow new subpages to be created
- Debugging shortcode problems
- Can’t change parent page
- How to exclude shortcode from specific page IDs if it’s set to global
- Show child pages when on a child page
- select a private page as parent for another private page
- Shortcode produces blank page
- WordPress pages with hierarchy
- load common thank you template with different content for different pages
- remove/hide pages from users backend
- conditional tags- how to use with shortcodes
- List child pages by slug not ID?
- Show own shortcode data on each page
- get_pages() & “child_of”
- Combining ‘depth’ with ‘include’ in wp_list_pages()
- Making audio playlist by getting page’s parent’s ID
- Removing Parent Page URL While Keeping the Navigation Intact
- Organizing Your Pages
- Custom page template for multiple pages
- Can a user find a child page?
- Display child pages in sidebar of parent page in wordpress
- Display child pages in a parent page? [closed]
- Redirect page to default subpage
- How to list a page tree?
- Is it possible to check for shortcodes on a page?
- Page access only from a specific page in wordpress website
- How To Render Shortcode In AJAX Response?
- Keep page hierarchy in wp_list_pages, even if on a child or grandchild
- Listing all child-pages of a parent-page on the parent-page and each child-page?
- How to control display of page lists on sidebar that doesn’t have childrens
- Check if page has subpages
- Exclude child pages args array
- Search anything from a Child and Sub-Pages of their Parent page
- How to get an array of pages ID by some page’s slug and all its children pages in get_posts() function?
- Return true if parent page id matches
- Shortcode runs when editing page
- If page or sub page not working as expected
- How to use wp_dropdown_pages or wp_list_pages to accomplish a menu like this?
- How to insert current user ID in a shortcode?
- Display grandchild page content on parent page
- Display inner pages like posts.[Like how post excerpt works]
- Pre-populating new Page creation with shortcodes
- Childpage title + content on Parent Page
- How to copy specific page content and create child page?
- How to output different content of page on different places in my template
- Pages redirecting to homepage
- custom page or standalone page?
- Firing page_publish where page is child page
- How to finish this loop?
- Get ID of the page where shortcode is included
- displaying child pages in columns when on a parent page
- How to make in post Parent page children page list nummbered
- Woocommerce – Making product pages child of shop
- List of pages – AJAX load more
- How to read a page’s “Shortcodes” from the Template File?
- Slug of a child page is accessible with and without the parent slug in the URL
- How to get a list of pages (not posts) with specific tags?
- I reached halfway through a WordPress tutorial to find out I began wrong for a new comer to WP
- Fresh WordPress installation not able to simply show page content
- Can’t create new pages in wordpress
- Custom template is not showing up in templates dropdown list after re-naming it
- How to add page category slug to base url
- how to add a .accdb file to your wordpress website
- Why is a page shown with ‘hidden’ next to the name in the list of pages if the page is set to public?
- How to change the default location where new post gets stored?
- May I know where to edit the tax rate?
- Need pages with same names in multiple subdirectories
- Why does updating the front page give a 403, but no other page?
- Website content shifted all the way to the left
- Live page errors should be hidden
- Search page doesn’t recognise post_type=page
- Best approach to create a customized page
- How to make a secondary Pages Screen
- Dynamic activation page in WordPress
- How to force a page to load and have a particular dynamic tab as active
- Very strange problem with occasional 404 errors
- Remove element from admin page editing part
- Subpage for Custom Post Type
- Site Library issue
- Change meta information for link to page
- All content of one page shifted to the left
- Landing Pages and Pop Up Overlay
- how to update page without reloading the page builder?
- Restrict page to members only does not work for page ID, slug or page title
- Why Does get_page_by_path Return The Sample Post?
- Added .lowercase-alpha-list now my list is adding an extra period
- Search Result to Link to a Specific Page
- How do you add a filter to wp-block-page-list?
- Adding a Admin Style Table in a WordPress 4.x Page