Show Custom Page Title for Same LoopBuddy Layout on Different Pages via Shortcode

(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
  
 
That will show the custom page title just for that specific post/page where the Layout is being shown.
 
That will show the custom page title just for that specific post/page where the Layout is being shown.
*Related links:
+
Related links: [http://ithemes.com/forum/index.php?/topic/18046-displaying-the-page-title-on-which-i-am-using-loop-buddy/ LoopBuddy user Bruce asking about and then sharing the code to show custom Page Titles on each Page where the same LoopBuddy Layout is used]
**[http://ithemes.com/forum/index.php?/topic/18046-displaying-the-page-title-on-which-i-am-using-loop-buddy/ LoopBuddy user Bruce asking about and then sharing the code to show custom Page Titles on each Page where the same LoopBuddy Layout is used]
+
  
 
<br />
 
<br />
 
[[:LoopBuddy|← Back to LoopBuddy Codex Home]]
 
[[:LoopBuddy|← Back to LoopBuddy Codex Home]]

Revision as of 16:36, July 22, 2013

One awesome example of using Shortcodes with LoopBuddy is to show a custom page title, along with any LoopBuddy Layout content, where different pages use the same LoopBuddy Layout. Our awesome LoopBuddy customer Bruce provided the following info to help you all with that:

  • 1 : Put the following anywhere (usually near the end of the file) in your theme's custom functions.php file:
function return_title() {
return '<h1>'.get_the_title().'</h1>';
}
add_shortcode('pg_title', 'return_title');
  • 2 : Add [pg_title] anywhere in the LoopBuddy Layout where you want to show the custom page title.

That will show the custom page title just for that specific post/page where the Layout is being shown. Related links: LoopBuddy user Bruce asking about and then sharing the code to show custom Page Titles on each Page where the same LoopBuddy Layout is used


← Back to LoopBuddy Codex Home

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox