如何在条件中添加条件

I have this code

<?php if (is_page_template()) {
} else {
get_sidebar();
}
?>

I want to integrate two options to the if condition

if (is_front_page())

how do i put it together in the php code so it would work

i tried

<?php if (is_page_template()) ||  (is_front_page()){
} else {
get_sidebar();
}
?>

but it does not work. sorry I'm not really good at programming.

any help would be appreciate it :)

You just had two extra parenthesis.

The Good

<?php 
if (is_page_template() ||  is_front_page())
{
} else {
    get_sidebar();
}
?>

The Mistake

<?php if (is_page_template()) ||  (is_front_page()){
                            ^-----^  Not Required

There is issue with the closing bracket ')' of if condition. Try this.

<?php if (is_page_template() ||  is_front_page()){
} else {
get_sidebar();
}
?>

You close the conditional too early

<?php if (is_page_template()) ||  (is_front_page()){

this will work:

<?php if (is_page_template() ||  is_front_page()){