Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wpbp_get_template_part name issue #1

Closed
quasiperfect opened this issue Nov 8, 2017 · 6 comments
Closed

wpbp_get_template_part name issue #1

quasiperfect opened this issue Nov 8, 2017 · 6 comments
Labels

Comments

@quasiperfect
Copy link

if i don't specify a 'name' the template doesn't get loaded you need a additional condition

something like

if ( !$template && !$name && file_exists( $path . "{$slug}.php" ) ) {
    $template = $path . "{$slug}.php";
}
@Mte90
Copy link
Member

Mte90 commented Nov 8, 2017

Where is this code? I think inside the method wpbp_get_template_part on line 34.
Can you explain better, also with an example of use with parameters? I need more information to define if it is a bug.

@Mte90 Mte90 added the question label Nov 8, 2017
@quasiperfect
Copy link
Author

i have for example

wpbp_get_template_part(D_TEXTDOMAIN, get_post_type() , '', FALSE);

and it should load for 'artists' cpt the artists.php file
no condition from you current function will include my file

on line 34 you test for a file but not for the variant without any name specified

@Mte90
Copy link
Member

Mte90 commented Nov 8, 2017

@Mte90
Copy link
Member

Mte90 commented Nov 8, 2017

Uh okay is a bug this search on plugin folder but not on the theme, I will release asap a new version.

@Mte90 Mte90 closed this as completed in 278fea3 Nov 8, 2017
@Mte90 Mte90 added bug and removed question labels Nov 8, 2017
@Mte90
Copy link
Member

Mte90 commented Nov 8, 2017

Can you check if this patch resolve the issue: https://github.com/WPBP/template/blob/master/template.php#L34

@quasiperfect
Copy link
Author

yes is ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants