As Maruti Mohanty mentioned you might not be using get_template_part in the correct way. The first argument is the slug name for the generic template. The second argument is the name of the specialized template. So currently your code is doing the following:
- On the page that has the ‘custom-page’ slug, display the template part named
custom-logo-top.php
. - If that file doesn’t exist then just display the generic template part called
custom-logo.php
I’d probably name your template parts ‘logo.php’ and ‘logo-custom.php’. It’s worth having a look through the Twenty Fourteen theme that comes with WordPress as well as the codex whenever you’re unsure of anything.
Related Posts:
- Get the php template file from other theme folder
- get_template_part not working with ajax
- Template part inside shortcode, unexpected reult
- how could I load a different template part by page
- get_template_part based upon post’s category
- get_template_part for specific page
- Using same variable names in files added with get_template_part()
- Echo a shortcode div after every 3 posts
- Using ob_start and ob_get_clean with wordpress shortcode
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- Select through customizer the template part to be viewed
- get_template_part function and add images
- how to replace h1 entry title with h2 in category pages only
- Contain multiple page templates in one PHP custom template file in WordPress?
- Using the get_template_part method within an mu-plugin not possible?
- How to use get_template_part always relatively to the file I’m using it in?
- Call get_template_part() custom permalink
- When using shortcode, content stops generating after the_content
- Removing get_template_part in child theme
- Is this correct get_template_part() in WordPress?
- If I define a variable in header.php, how do I make it available to templates?
- Headers already sent error with get_template_part in REST API call
- Query both first_name and last_name from wp_usermeta at the same time
- Image Upload “exceeds the maximum upload size for this site”, but php.ini is correct
- PHP – redirect https to http and www to non-www
- simple wordpress ajax plugin not working when not logged in
- Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied
- Notice: Constant already defined in wp-config.php on (non-existent) line?
- body_class filter – Is there a better way to write this code?
- A Specific Blog post to be assigned as the landing page of my wordpress blog
- Sort registered users by post count? (inside admin dashboard)
- The custom logo, site title, and description doesn’t appear at the same time
- How to change a public function inside a class of a plugin?
- OrderItem get_total() returns lower value than $order_item->get_product()->get_price() * quantity
- Put CSS inside a PHP file and include it the right way
- js file in root loading without
- Why is the post meta[] empty when I make a call to the wordpress rest api?
- WooCommerce – Reset quantity input field when variation changes
- Query all posts of a custom taxonomy term
- How to create a form and display its content as table in admin panel?
- Different loop output every x posts in custom post type
- Trying to get property of non-object “ wordpress ”
- Dynamic Sidebars & Echo
- Add_action not working in required file of functions.php
- Add to cart function not working for first product when cart is empty [closed]
- How to abort saving data in save_extra_profile_fields function WordPress?
- Slick + PHP + ACF + JQuery slide reveal not working
- Get the date of the className or classID
- Using Select HTML in Bootstrap Popovers
- Building a WordPress App
- WordPress Options Page Theory Question
- PHP in CSS file?
- Help getting previously visited pages ID
- Warning: printf(): Too few arguments in helpers.php file
- Any ideas why I am getting “I’m getting “wp-admin/admin-ajax.php 401 (Unauthorized)”
- Woocommerce Product_cat for current category page
- Get featured image with custom size outside WordPress
- How to use the checked() function to check for a non-empty var
- How to add post thumbnail dynamically using Jquery?
- WordPress redirects to old login after migration
- How do I remove duplicate users from two merged WP_User_Query objects?
- How to do something when user profile rendereing?
- Get the featured image url of clicked post
- How to refresh a page from jquery [closed]
- How to get comment_ID by post_ID in wordpress
- Add a select-option to the default widgets
- WordPress doesn’t load HTML
- WordPress low speed after migrating to new host
- Show all people who commented on all posts by an author
- Using php code inside style tag
- How to pass values from one function to the other using an array variable
- Custom global variable not working in function
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- How to change the content width using php?
- get_the_author_meta( ‘ID’ ) just return 1
- Add widget area from visual editor
- Register/enqueue scripts only on certain admin pages
- Looping through custom data in a custom table to display all items in a post
- Site title not showing. Please help me
- Email always ends up in spam
- How to link featured images in single.php for only non-logged-in users?
- Grouping posts by date
- WordPress Redirect / Add_Rewrite_Rule – Non Index.php Page
- Target a specific container to style on WordPress storefront theme
- Search the post using get_search_form()
- Need to Echo A Url path to show on a wordpress page
- How to Pass Current Taxonomy Terms into new WP_Query?
- How can I move the posted-on date above the post and below the entry-header?
- How to list categories by page id in wordpress
- ‘posts_per_page’ in costum page type
- WordPress upload images not displaying
- how to exclude admin page from add_rewrite_rule in wordpress
- How to use ‘depth’?
- Pagination on Custom Loop
- Passing multiple variables through url (php)
- Query Concatenation
- Link a lightbox thumbnail to a post instead of opening the lightbox
- Custom taxonomy with page post type – WordPress
- Alternative to php echo within code
- Why does WordPress not send the user the email to add a password?