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

(Difference between revisions)
Jump to: navigation, search
(Created page with "*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 L...")
 
Line 1: Line 1:
*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:
+
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:
+
*1 : Put the following anywhere (usually near the end of the file) in your theme's custom functions.php file:
 
<pre class="brush:php">
 
<pre class="brush:php">
 
function return_title() {
 
function return_title() {
Line 6: Line 6:
 
}
 
}
 
add_shortcode('pg_title', 'return_title');</pre>
 
add_shortcode('pg_title', 'return_title');</pre>
**2 : Add
+
*2 : Add <code><strong>[pg_title]</strong></code> anywhere in the LoopBuddy Layout where you want to show the custom page title.  
<code><strong>[pg_title]</strong></code>
+
 
+
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.
 
That will show the custom page title just for that specific post/page where the Layout is being shown.

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.


← Back to LoopBuddy Codex Home

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox