Site logo

[Resolved] Click the article link on page A to jump and then go to the new page B. How to s

Home Forums Support [Resolved] Click the article link on page A to jump and then go to the new page B. How to s

Home Forums Support Click the article link on page A to jump and then go to the new page B. How to s

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #2473436
    RYAN

    That is, when I click any article appearing on the home page, it will not appear on the new tab. How to set the home page? I can’t set it in the menu
    There is no option in the menu

    #2473447
    Fernando
    Customer Support

    I see. Can you share admin login credentials? We’ll take a closer look at the issue.

    Please use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    #2473452
    RYAN

    Yes, my friends I trust you

    #2474237
    Fernando
    Customer Support

    So, if you do not want the Home menu item to open in a new tab, uncheck the “Open the link in a new tab” in its menu settings. See: https://share.getcloudapp.com/GGuJWrmG

    If you’re referring to something else, let us know.

    #2474306
    RYAN

    I know that
    But I’m not talking about that. What I want is that when I click any article on the home page, I can open it on the newly created page, not on the original home page,
    Just like other pages, when I click the article in it, a new page will pop up and open. I want this effect
    So the current problem is that the home page does not have this effect. How can I set it and how can I have this effect like other pages

    #2474336
    Fernando
    Customer Support

    I see. Thank you for clarifying. Can you also try adding this Snippet:

    add_filter('generate_featured_image_output', function($output){
    	if(is_home() && !is_admin()){
    		$my_search='href="';
    		$my_replace='target="_blank" href="';
    		$output = str_replace($my_search, $my_replace, $output);
    		
    	}
    	return $output;
    }, 10);
    
    add_filter('generate_get_the_title_parameters', function($output){
    	if(is_home() && !is_admin()){
    		$my_search='href="';
    		$my_replace='target="_blank" href="';
    		$output = str_replace($my_search, $my_replace, $output);
    		
    	}
    	return $output;
    }, 10);

    Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets

    #2474339
    RYAN

    Ok, it’s finally OK. Thank you for your patient reply. I’m very lucky to meet you

    #2474343
    Fernando
    Customer Support

    You’re welcome, Ryan!

Viewing 8 posts - 16 through 23 (of 23 total)
  • You must be logged in to reply to this topic.