Q2A Market - Support

We are here to provide you support for Q2A Market premium and free products. If you have any issue in installation, option settings or any bug you found. Please create a ticket. We would try to get back to you as soon as possible.

how to remove "Front Page" text from home page title

my website show the front page plugin as the home page.
the definition of the plugin changes the home page title in a way it contains the text "Front Page" in addition to the website name.

        <META NAME="viewport" CONTENT="width=device-width, initial-scale=1, maximum-scale=1">
        <title>Front Page - למה? כמה?</title>

how can i remove the text front page from my home page title?

in my plugin definition the option "Hide Page Title" is checked.

opened on Dec 25 in Front Page

1 Answer

Nice and valid point which needs great consideration. Thanks to bring it to our attention.

Did you try by changing the Page name to your website name itself? If not could you please try it once if it works. Meantime I will looking to the code and if it requires any conditional statement than will update and push it to the store.

[ Here is the fix ] --------------------------------------------------------------------------------

open file q2am-front-page-custom.php from q2am-front-page plugin directory
at line #95 fine below code

Find

/* TRANSFER LANGUAGE STRINGS */
$lang_page_title = qa_lang_html('q2am_front_page_lang/page_title');

and Replace with below

/* TRANSFER LANGUAGE STRINGS */
$url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$lang_page_title = ($url == qa_opt('site_url')) ? '' : qa_lang_html('q2am_front_page_lang/page_title');

This will check if you have set the Front Page as a home page than it will remove the Front Page title and will only display the Site Name

answered Dec 25
edited Dec 26

What do you mean by changing the page name?
where can i edit the page name?
isn't it hard coded?
doesn't it work like this > index.php call front page plugin and the plugin insert the page title?

I have updated the answer with the fix. Check the answer after [ Here is the fix ] text

Hi,
thank you for the quick fix.
it solve my problem but you should know that it is only partial solution because it works if the home page url is in the format and not if its without the www > (in this case it keeps the "front page" text).

Yes I understand what you mean. This is bit tricky since Question2Answer doesn't have built in function to check home page if any other page has been set in array instead of Q2A default.

This is why we have to use custom made url checker. The modified code will check with https, http://, and www and compare with the site (home) url. Also checking if Q2AM Front Page has been set as a home page. If not than it will not remove the Front Page title.

Replace below code with previous code

Modified code:

global $qa_request_map;
$url = (@$_SERVER["HTTPS"] == "on") ? "http://" : "http://";
$url .= $_SERVER["SERVER_NAME"];
if($_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443")
{
    $url .= ":".$_SERVER["SERVER_PORT"];
}
$url .= $_SERVER["REQUEST_URI"];        
$lang_page_title = (array_key_exists('q2am-front-page', $qa_request_map) && $qa_request_map['q2am-front-page'] === '' && $url == qa_opt('site_url')) ? '' : qa_lang_html('q2am_front_page_lang/page_title');

still not working when home page is without www

Just wonder why doesn't work with www since the code consider the actual URL.

Than do one more update to your code as per your website URL

If you are using http://www or https://www than please add www to your code.

$url = (@$_SERVER["HTTPS"] == "on") ? "http://www" : "https://www";

Q2A site will consider your website URL you have set in Admin > General > Site URL so if you have set www or not the browser will automatically modify URL based on that.