an
groups-icon

Enclose PHP in membership shortcode

Wait a minute... This content is very very old. We no longer sell or support this theme version. New Topics
  • Version 9
    fred jones
    0 points
    Beginner

    Thanks for reading

    I need to hide the about me widget from membership “1” but display it to membership “2”

    I know I should create a child theme for code changes but I dont want to go that route. yet.

    I want to add the shortcode to author.php to enclose all the content within that file.

    using <?php echo do_shortcode(‘[MEMBERSHIP ID=”2″]

    non-working example:
    [code title=”Author.php”]<?php
    /*
    * Theme: PREMIUMPRESS CORE FRAMEWORK FILE
    * Url: http://www.premiumpress.com
    * Author: Mark Fail
    *
    * THIS FILE WILL BE UPDATED WITH EVERY UPDATE
    * IF YOU WANT TO MODIFY THIS FILE, CREATE A CHILD THEME
    *
    * https://codex.wordpress.org/Child_Themes
    */
    if (!defined(‘THEME_VERSION’)) { header(‘HTTP/1.0 403 Forbidden’); exit; }
    ?>
    <?php echo do_shortcode(‘[MEMBERSHIP ID=”2″]
    <?php get_header(); ?>

    <?php hook_author_before(); ?>

    <div class=”panel panel-default” id=”AuthorSingle”>

    <div class=”panel-heading”><?php echo $CORE->_e(array(‘author’,’15’)); ?></div>

    <div class=”panel-body”>

    <div class=”row”>

    <div class=”col-md-4″>

    <?php echo get_avatar( $authorID, 200 ); ?>

    <div class=”clearfix”></div>

    </div>

    <div class=”col-md-8″>

    <h2><span><?php echo get_the_author_meta( ‘display_name’, $authorID); ?></span></h2>

    <div class=”linkbar”>
    <?php

    // URL
    $data = get_user_meta( $authorID, ‘url’, true);
    if(strlen($data) > 0){
    echo “<span><i class=’fa fa-globe’></i> “.$CORE->_e(array(‘button’,’12’)).”</span> “;
    }

    // FACEBOOK
    $data = get_user_meta( $authorID, ‘facebook’, true);
    if(strlen($data) > 0){
    echo “<span><i class=’fa fa-facebook-square’></i> Facebook</span>”;
    }

    // TWITTER
    $data = get_user_meta( $authorID, ‘twitter’, true);
    if(strlen($data) > 0){
    echo “<span><i class=’fa fa-twitter-square’></i> Twitter</span> “;
    }

    // LINKEDIN
    $data = get_user_meta( $authorID, ‘linkedin’, true);
    if(strlen($data) > 0){
    echo “<span><i class=’fa fa-linkedin-square’></i> Linkedin</span>”;
    }

    // SKYPE
    $data = get_user_meta( $authorID, ‘skype’, true);
    if(strlen($data) > 0){
    echo “<span><i class=’fa fa-skype’></i> Skype </span>”;
    }

    ?>
    </div>

    <?php

    // DISPLAY USER DESCRIPTION
    $dee = get_the_author_meta( ‘description’, $authorID); if(strlen($dee) > 1){ ?>

    <?php echo wpautop($dee); ?>

    <?php } ?>

    </div>

    </div>

    <hr />

    <h4 class=”text-center”><?php echo str_replace(“%a”, $listingcount, $CORE->_e(array(‘author’,’1′))); ?>

    <?php

    if($listingcount > 0){?><div class=”ulistings”>/?s=&uid=<?php echo $authorID; ?>” style=”text-decoration:underline;”><?php echo $CORE->_e(array(‘author’,’2′)); ?></div><?php } ?>
    </h4>

    <?php hook_author_inner_bottom(); ?>

    </div>

    </div>

    <?php hook_author_after(); ?>

    <?php get_footer();
    [/MEMBERSHIP’); ?> [/code]

    If I am making this harder than I should please tell me.

    have a good day.

    October 31, 2014 at 3:33 am
  • fred jones
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    October 31, 2014 at 4:26 am
  • Richard Bonk
    -1 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    October 31, 2014 at 10:25 am

535

Views

2

Replies