• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Replace Minimum Pro Themes Tagline With Custom Field

The Minimum Pro theme by StudioPress includes a tagline which displays the same content site-wide after your header.

Update : This new tutorial provides the code which enables you to add both a custom tagline and a custom CTA button.

In this tutorial, we’ll replace the tagline with a custom field which enables you to add unique content in the tagline area of any or all single posts and pages.

Here’s an example of unique content which only displays in the tagline area of one single post:

Tagline Custom Field

Here’s the default tagline which displays site-wide after the header.

Minimum Theme by StudioPress

There’s 3 steps you will need to follow:

  1. Add PHP code in your child themes functions.php file.
  2. Add CSS code to the end of your child themes style.css file.
  3. Create a new custom field using the native WordPress custom fields meta box on any Edit Post screen

Register for full access

Related Code

  • 6 Ways To Display Custom Fields Using Custom Functions – Code Examples

Minimum Pro Theme

Reader Interactions

Comments

  1. idealynx says

    March 1, 2015 at 6:48 pm

    Brad, what do I do if I want to keep the existing tagline formatting (font size and CTA button), but I want to customize the tagline for individual pages?

    Log in to Reply
    • Brad Dalton says

      March 1, 2015 at 11:55 pm

      Kelly

      Use the default CSS rules from the style.css file with the tagline-container class which i have added
      or
      the default divs which include 2 classes you can see in the default PHP in functions.php

      Also, use the is_singular(‘page’)) conditional tag

      Log in to Reply
    • Brad Dalton says

      March 2, 2015 at 1:28 am

      Just updated the post with the code you need.

      You will need to add the custom CSS for the tagline-container class which applies to your custom field for single pages.

      Log in to Reply
  2. James says

    January 15, 2015 at 7:59 pm

    Any suggestions on the best way to set a default content for the site tag on pages other than a post or page. I’d like to find a way to create a site tag for a category page or the home page

    the site tag shows up on a category page and the home page with

    if ( get_field(‘custom_tagline’) && is_page() or is_category() or is_home()

    but I’m not sure the best way to add content to the tag

    Log in to Reply
    • Brad Dalton says

      January 16, 2015 at 6:07 am

      Try

      ! is_singular('post','page'))

      To exclude single posts and single pages

      Log in to Reply
      • James says

        January 16, 2015 at 6:20 am

        Sorry I should have checked how I phrased the question.

        I meant in addition to the individual posts and pages. For example when there is a menu with a direct link to a category or the home page.

        Those pages can’t be edited like a post and don’t have the acf meta box to enter the site tag content.

        I previous had a function that added a site tag and site tag widget on the home page and on specific category pages but it was removed with this edit. Basically I’m trying to do both!

        Log in to Reply
        • Brad Dalton says

          January 16, 2015 at 6:29 am

          whats a site tag?

          Log in to Reply
          • James says

            January 16, 2015 at 1:36 pm

            Tagline. Sorry I combined site tagline!
            The tagline is blank on this page that is generated with a menu link to a category.

          • Brad Dalton says

            January 17, 2015 at 1:25 pm

            You can hard code the default text like this:

            echo '<div class="custom-tagline">';
            echo 'Your Default Text';
            echo '</div>';

            And change the conditional tags

            ! is_singular('post','page'))

            Or you could modify the code like this

            else {
            echo '<div class="custom-tagline">';
            echo 'Your Default Text';
            echo '</div>';
          • James says

            January 21, 2015 at 2:03 am

            From your updated code instead of using default text for categories I’m using the Category Description.

            I replaced

            echo ' Archive Text ';

            with

            echo ''. category_description('') .'';

            I was wondering why the css isn’t applied with this change? If you add html to the category description it renders but the css doesn’t get applied.

          • Brad Dalton says

            January 21, 2015 at 10:42 am

            Not sure why as it should if its wrapped in a div class. See the last code snippet for an example.

  3. Lisa Sawyer says

    November 30, 2014 at 8:27 pm

    Brad – thanks for the post and your ongoing assistance in the support forum.
    Lisa

    Log in to Reply
    • Brad Dalton says

      December 1, 2014 at 1:09 am

      Hi Lisa

      Support information. http://wpsites.net/registration/

      Log in to Reply
  4. David says

    August 27, 2014 at 4:24 pm

    I like the customizability of this. Is there a way to have a background image in the tagline too? I uploaded an image to use as a background and then got rid of the color background.

    .site-tagline {
    	/*background-color: #0B7AD2;*/
    	border-bottom: 1px solid #eee;
    	margin-top: 60px;
    	padding: 40px 0;
    }

    Unfortunately, it doesn’t seem to work. Well it work on the homepage only… I guess I’m missing a piece of the puzzle. Ideas?

    Log in to Reply
    • Brad Dalton says

      August 27, 2014 at 4:42 pm

      I don’t have the code setup in the them anymore however once you have the correct class, you could simply add a image using CSS:

      .custom-tagline {
          background-image: url('images/bg.png');
      }

      Assuming custom-tagline is the correct class which you can check using your favorite browser tool.

      Log in to Reply
      • David says

        August 27, 2014 at 4:58 pm

        Much appreciated, but nothing seemed to change for me. I kept the class as .site-tagline as I’m just trying to overwrite what already existed.

        .site-tagline {
        	/*background-color: #0B7AD2;*/
                background-image: url('images/VBN4tagline_bg.png');
        	border-bottom: 1px solid #eee;
        	margin-top: 60px;
        	padding: 40px 0;
        }
        Log in to Reply
        • Brad Dalton says

          August 27, 2014 at 5:04 pm

          Hard to say without seeing your site but if that’s the correct class then it should display the image if the file name and path are correct otherwise it may be caching which needs clearing.

          Log in to Reply
          • David says

            August 27, 2014 at 5:12 pm

            I deleted the cache, but still no go. The tagline image works on the homepage, but not the services or other pages.

            Thank you,
            David

          • Brad Dalton says

            August 27, 2014 at 5:17 pm

            Add this at the every of your style sheet

            .site-tagline {
                background-image: url('images/bg.jpg');
                color: white;
            }

            And change the image name and extension to match your own.

            Tested and works.

          • David says

            August 27, 2014 at 5:27 pm

            Brad,

            Thanks! Your last entry worked just great!

            – David

          • Brad Dalton says

            August 27, 2014 at 5:28 pm

            Yeah, strange why it works at the end of the file but not when you modify the default CSS. Must be more CSS somewhere that needed changing.

  5. Pedro says

    January 2, 2014 at 8:53 pm

    Sorry,

    I think I did not understand how I to ‘replace’. Should I delete some code? Just write it in the end as I do with CSS?

    I found that the first part (Add support for structural wraps) does exist already, so I just added that last one (Replace Site Tagline With Custom Field) in the end of functions.php and now there appear two fields instead of one.

    My website is pedromaiquez.es

    Thanks in advance! 🙂

    Log in to Reply
    • Brad Dalton says

      January 2, 2014 at 9:29 pm

      Yes, you will need to remove the original code an replace it with the modified version.

      Log in to Reply
  6. David says

    January 1, 2014 at 1:04 am

    Each time that I do this I loose the navigation which I have set to the primary navigation location. I modified my statement down to this as I would like to use it on all pages, but not posts.

    if ( get_field(‘custom_tagline’) && is_page() ) {

    Here is my ACF settings also: https://www.dropbox.com/s/v7a6st3njl140ao/ACF.png

    I am sure it is something simple that I am doing wrong. The functions, and css are input using genesis extender

    Log in to Reply
    • Brad Dalton says

      January 1, 2014 at 7:18 am

      Hello David

      What you could do is use the custom menu in the header right widget area or reposition the primary nav menu.

      It may be where you placed the code because the screen shot proves it works but if you put the code in the wrong file, it may not.

      I didn’t use Genesis Extender when i tested the solutuon.

      Log in to Reply
  7. Darren DeMatas says

    December 3, 2013 at 3:08 am

    This was really amazing and just what I was looking for. REALLY appreciate this.

    Log in to Reply
  8. Darren DeMatas says

    December 3, 2013 at 3:05 am

    Thanks a ton!

    Log in to Reply
    • Brad Dalton says

      December 3, 2013 at 1:11 pm

      No worries Darren.

      Log in to Reply
  9. Erik says

    November 30, 2013 at 7:20 am

    Hi Brad, great tutorial, thanks. One question: does it also work on pages?

    Log in to Reply
    • Brad Dalton says

      November 30, 2013 at 11:45 am

      Hello Erik.

      You will need to customize the conditional tag to work with pages as this post works with single posts only.

      Log in to Reply
      • Erik says

        November 30, 2013 at 12:04 pm

        Thanks Brad, can you please tell me what and where to put things, since I am not very familiar to coding.

        Log in to Reply
        • Brad Dalton says

          November 30, 2013 at 12:27 pm

          What you can do is change the conditional tag from is_single() to is_page().

          You can learn more about conditional tags on the WordPress Codex http://codex.wordpress.org/Conditional_Tags

          Log in to Reply
          • Erik says

            November 30, 2013 at 12:50 pm

            Ok, I understand, thanks anyway

          • Brad Dalton says

            November 30, 2013 at 1:22 pm

            I updated this post to include pages which should help you achieve what you want.

          • Erik says

            November 30, 2013 at 2:06 pm

            Thanks again

  10. Keith Davis says

    November 29, 2013 at 5:36 pm

    Hi Brad
    I’ve got to change my main site over to Minimum Pro pretty soon so I’m keeping an eye on your Min Pro posts.

    Useful stuff as ever.

    Log in to Reply
    • Brad Dalton says

      November 29, 2013 at 6:22 pm

      Hi Keith.

      Look forward to seeing your new site on Minimum Pro.

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.