A simple if statement should do, so something like this:
function my_theme_navigation() {
if( get_option( $shortname .'_next_prev_or_paginate' ) == 'Next/Previous Links' ) :
// the block for next-prev navigation
else :
// the code for pagination
endif;
}
I have no way of knowing what the array in your first code block exactly does, but I think I got it right. The only thing you’d still have to do is substitute $shortname
with whatever that variable holds. If it’s a global, then just add global $shortname;
to the top of the function. I am also assuming that the values of the select options are the same as the titles.
Related Posts:
- Automatically adding a link to the next page link before ” tag in posts?
- How is the Page Splitting implemented in the theme?
- Display Both next previous and number in single page [duplicate]
- Test for if you’re on 1st page of paginated post (with nextpage quicktag)
- Get next and previous page of paginated post
- Changing pagination list class
- How to add CSS Class to previous_post_link or get previous/next post link URL
- Pagination resolving to first page only
- Pagination of RSS2 feed
- List posts based on first letter of posts
- Modifying WP_LIST_AUTHOR Functions to output all users in a grid (and Paginate)
- Problem: ( kriesi ) pagination doesn’t work in homepage [duplicate]
- Custom loop pagination issue ( pagination not showing up )
- How to ignore or disable nextpage tag?
- WordPress Pagination not displaying posts after certain page
- Show next / previous text (button) all the time
- Pagination difficulty using custom query in genesis-based custom theme
- Placing Ads after every 10th Post with Infinite Scroll
- How to implement pagination in backward way eg. first – 20 – 19 – 18 – … – 3 – 2 – 1 – last
- Next & Previous (Pagination in this case) Not Appearing
- Limit Timber pagination number items
- List all posts by year with pagination
- WordPress wp_link_pages show only next/prev link
- Pass additional parameter in the URL
- Pagination: /tags/tag_name/?paged=2 gives a 404 error
- Post timeline (pagination with date, not numbers)
- Why do next pages load the same content rather then older articles?
- Nested Pagination
- Pagination stopped working after assigning custom page template to new page (different slug)
- I want to remove numbers from the_posts_pagination function
- Yoast’s rel=“next” & rel=“prev” tag don’t work on static homepage’s paginated pages
- Modify WP_List_Table pagination “item(s)” text?
- How to stop WordPress returning 404 on paginated pages after using add_rewrite_rule()?
- Using paginate_links() to generate “01, 02, 03, 04” paginations
- Pagination customization
- Pagination w/Static Front Page
- Post Pagination Modifications (wp_link_pages)
- Authors list Pagination : result set from $wpdb->get_results()
- WP-PageNavi on Custom page template not working
- /tag/tag_name/page/2 gives a 404 error
- Paginated Archives or Loop by Month
- Pagination Not Working on `WP_Query` Archive Page
- How do I make my pagination work?
- How to use custom previous/next link ?
- How to paginate a list of child pages
- Show content based on page number
- Pagination issue in archive.php
- How to use pagination?
- How to get category/tag in URL for Pagination links?
- Post Navigation Not Working In Blog Template – Redirecting to same page with correct URI
- How to get rest api pagination headers via fetch
- Include a leading zero in pagination
- Pagination not work on page but work on category
- Custom category.php paging shows the same posts
- Pagination Links showing incorrect previous page number
- How to limit page pagination… again
- Conditional pagination li’s
- Paginate Links – Mid Size Less Than 2
- Different page template for paginated content?
- Change the format in the paginage_links
- tax_query does not work with pagination with custom query (both wp_query and query_posts())
- Pagination for multiple queries merging into one Loop
- paginate_comments_links() not working
- Adding paging to get_posts()
- Can I paginate this get_attachment query?
- Blog pagination WITHOUT using max_num_pages
- How to Show Next-Previous Link Only
- WordPress static home page pagination not working
- Why my pagination gets 404?
- How do i make the_posts_pagination look like my template?
- How to create a WordPress gallery with pagination
- Broken pagination links on WP 4.9.10 blog pages
- Excluding posts without affecting the number of posts per page
- get_next_posts_page_link adds Inexistent directories
- why pagination not working in page template
- Set Pagination count according to post count
- Only show pagination when post count exceeds show post
- Pagination – linking back to base page – Page 1
- Custom Pagination shows same posts on each page
- Numbered pagination showing all numbers instead of paginated blocks
- Show next and previous page number
- Search pagination link redirecting to a link that doesn’t work with pagination
- Pagination diplays always 2 pages
- Combining content breaks category pagination
- Adding pagination to query for custom page
- Main page paginate_links issue
- Need help with get_posts pagination
- WordPress 404 pagination (/page/2) error?
- Excluding certain post status’s from pagination
- Removing template part when not on homepage if / else
- Paginate template name
- Next / Previous Posts not working
- How to reduce the number of pages in pagination
- foreach pagination
- paged query leads to 404? [duplicate]
- Pagination only working on index page not on a template page
- How to change `page` slug in pagination? on a specific pagination result (not globally)
- Two pagination in one page without being synchronous
- Change “/” (slash) before page number in pagination path to “-” (hyphen)
- Zeroise custom pagination to have leading 0