• Resolved nikkers

    (@nikkers)


    Am evaluating moving to Connections. I made a page where the directory is located and used the [connections] shortcode titling the page header as “Connections”

    So the default Connections page has “Connections” as main heading. Every page thereafter has “entry name”>>Connections. How make this be only “entry name” as the main heading please?

    Have tried changing it in customizer however no luck. Also if one buys a template is this configurable?

    Thank you

    • This topic was modified 9 months, 3 weeks ago by nikkers.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Steven

    (@shazahm1hotmailcom)

    The “Connections” in the title is the WordPress Page Title.

    The easiest way to remove “Connections” is to edit the page, delete the page title, and save the change.

    This might leave you with a trailing page title separator. If it does, this is a bug that I noticed and fixed. The fix will be in the next maintenance release scheduled for this week.

    I hope this helps; please let me know.

    Thread Starter nikkers

    (@nikkers)

    Yes, that does help thank you. The suggested method does leave a trailing page title separator. I’ll await the update.

    Can the bug be addressed so the main directory page can have the input page title e.g. Connections and any subpage only has that pages title?

    Plugin Author Steven

    (@shazahm1hotmailcom)

    RE: Can the bug be addressed so the main directory page can have the input page title e.g. Connections and any subpage only has that pages title?

    This is not a bug; it is an SEO breadcrumb. It can be turned off on the Connections Settings admin page under the SEO tab. Turning off the Page Title option will allow the page title to be displayed, but it will no longer dynamically change the page title to have the entry name.

    An alternative solution can be accomplished with the following code snippet that I just worked out:

    add_filter(
    	'cn_page_title',
    	static function ( $title, $pieces, $separator, $original, $id ) {
    		
    		if ( \Connections_Directory\Request::get()->isSingle() ) {
    			
    			$result = Connections_Directory()->retrieve->entries( 
    				array(
    					'slug' => urldecode( cnQuery::getVar( 'cn-entry-slug' ) ) 
    				)
    			);
    			
    			if ( ! empty( $result ) ) {
    
    				$entry = new cnEntry( $result[0] );
    				$title = $entry->getName();
    			}
    		}
    		
    		return $title;
    	},
    	10,
    	5
    );

    To use this, install the Code Snippet plugin. Here’s the link:

    Copy-paste the above code into a new code snippet, save and activate it.

    I hope this helps; please let me know.

    Thread Starter nikkers

    (@nikkers)

    Installed code snippet – (my attempt at fixing it produced a critical error, could you check the supplied snippet please?)

    Snippet automatically deactivated due to an error on line 16:

    Syntax error, unexpected token “;”, expecting “)”.

    Thread Starter nikkers

    (@nikkers)

    Also, yes the SEO settings at: wp-admin/admin.php?page=connections_settings&tab=seo allow showing page title as a breadcrumb. Is there an option to just show just the page title as only the page title? Guessing thats what the snippet would do.

    Plugin Author Steven

    (@shazahm1hotmailcom)

    RE: my attempt at fixing it produced a critical error, could you check the supplied snippet please?

    The code snippet is correct; it was tested. I just tested it again, and it seems good to go. Perhaps there was a copy-paste error when creating the new code snippet.

    Here’s the snippet.

    add_filter(
    	'cn_page_title',
    	static function ( $title, $pieces, $separator, $original, $id ) {
    		
    		if ( \Connections_Directory\Request::get()->isSingle() ) {
    			
    			$result = Connections_Directory()->retrieve->entries( 
    				array(
    					'slug' => urldecode( cnQuery::getVar( 'cn-entry-slug' ) ) 
    				)
    			);
    			
    			if ( ! empty( $result ) ) {
    
    				$entry = new cnEntry( $result[0] );
    				$title = $entry->getName();
    			}
    		}
    		
    		return $title;
    	},
    	10,
    	5
    );

    Please delete the snippet and create a new one with the code copied from above.

    RE: yes the SEO settings at: wp-admin/admin.php?page=connections_settings&tab=seo allow showing page title as a breadcrumb. Is there an option to just show just the page title as only the page title?

    Turn off that option and save the change. Now, only the page title will be displayed. To clarify, the option is Page Title under the Page Display section (it’s the only option). Turn off this option.

    I hope this helps; please let me know.

    Thread Starter nikkers

    (@nikkers)

    Copied and pasted the second snippet and it now works thanks! Have page title only when viewing an individual entry.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘customising title in every page’ is closed to new replies.