As i see your code in header.php and index.php looking messy (because of many if
conditions).
If i’m understanding your problem then i do it like this
- create separate author.php for both authors their name like
author-cait.php
andauthor-shannons.php
- Give link like
http://www.yousite.com/author/cait/
to button on static landing page.When user click on this,it takes him to author’s specificauthor.php
if exist - create custom header.php for both authors name like
header-cait.php
andheader-shannons.php
- create custom sidebar.php for both authors name like
sidebar-cait.php
andsidebar-shannons.php
- complete your code in author specific author.php for example
author-cait.php
contain only cait’s conditon,header and sidebar.
It makes your code looking beatiful,manageable, save from overloding of if
conditions.
Related Posts:
- Change Author Name to Sitename on Frontend
- Prevent 404 of Author pages without posts
- how to show all type of author posts in author page (SOLVED)
- Determine if page is the Posts Page
- Get the Current Page Number
- Stop WP from creating “Sample Page” and “Hello World!” post
- Keyboard shortcut for updating a page or post?
- Apply the_title() filter in post & page title, but not in menu title
- How to display by default only published posts/pages in the admin area?
- Get current menu_order
- Difference between an archive and a page listing posts
- Delete Associated Media Upon Page Deletion
- The next_posts_link() works only with original $wp_query
- Get content from one page and show it on another page
- How to Check if a Page Exists by URL?
- Hook that get’s triggered when the author of a post is changed
- the_author() returns empty string
- Connection lost. Saving has been disabled… (Updating Posts/Pages)
- get_children() Not Working with orderby Parameter
- Prevent Authors from viewing each others Posts
- Display Random Author with Details in Sidebar
- how to limit edit_form_after_title hook to page and post edit only?
- Using single.php from plugin folder instead of default template folder
- Post/Page Publish/Update button not clickable once I make an edit
- Strategy for handling hierarchical pages with empty parent content
- Skipping first 3 posts in wp query
- Custom Field in Featured image for A particular post
- How to add a new tab to page editor
- How to show list of posts by author and category?
- How to display the page title/content in the Posts page?
- WordPress: How to get the current logged in author page URL?
- Callback for wp.autosave.server.triggerSave();
- How can I see a list of pages and post where my custom Gutenberg block is used?
- How to add editor’s name to entry meta byline?
- Different permalink for posts and authors
- Restore contents of deleted user
- disable password protected page for logged users
- How to change post to page
- RSS for Pages Instead of Posts?
- How to display posts by current user/author in a custom page template?
- Display posts by tag on page
- Query posts distinct authors
- Why do I need to use The Loop on pages (inside page.php etc)?
- What is the difference between “post” and “page” in WordPress?
- Create custom page in WooCommerce
- posts page – different lengths of excerpt
- WordPress automatic and permanent page
- Restrict the Number of Posts an Author can Publish (over time)?
- Is there a WordPress equivalent to MediaWiki templates
- Determining Slug Before and After Edit
- Search posts by post author name
- Get the user type of an author
- Getting an alphabetic post list with two letters onclick on letter
- Automatically create pages in a post based on number of words
- Static posts page with home.php
- Show the title of the latest post by author
- Find most recent authors
- Change WordPress post-state in Admin Area
- Pagination not working on Custom Page Template
- Show author post count in sidebar – Variable
- Set number of article per number of page
- Get current users post URL?
- Get the author of the latest revision
- Filter posts by author and category simultaneously
- Pagination for Pages and Posts
- Custom Post Type & Author not associating, user post count is 0, api doesn’t return author in post objects
- Is it possible to show a different WP menu when using password protected pages?
- Can I change a post to a page by changing it’s type?
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- Overview with latest edited posts and pages
- how to show all post in my page-grid.php template page
- eBooks download website, page or post?
- Multiple loops in same page, without duplicate content
- Add a custom option to a page in backend
- Include related posts on a page
- Post author is changed to admin after his post is modified by admin
- why does HTML Tag not working in Post and Page
- Creating new page with pre-defined parent page
- Get all posts by post_author
- problem to delete page
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- Populating a page with content from post custom fields
- Can I hide a specific post from latest posts page?
- Hide add new page button
- How can I control multiple editing of wordpress posts?
- Edit menu item title from edit page/post
- Redirect before post page
- Multiple authors for single post without plugin
- Limit number of posts a user can make per minute?
- $post object is null
- How to show post(excerpt) from specific category on wp page?
- When paginating a Page with the tag, how can the 2nd and subsequent page styles be customised?
- Authors in menu, template list post by author
- Show the author’s count of total amount of posts assign to a custom taxonomy term
- Author must complete profile info before they can publish a post?
- Is there any WordPress alternative to Book module of Drupal?
- Changing my permalink structure – will new layout conflict with existing page?
- WP rest api returns 404 only when author param is used
- Convert a complex webpage into WP theme
- How To Keep Posts from Being Displayed Two or More Times on My Homepage? [closed]