Customise Author Page?

You will need something like this in your author.php file. Taken from the Codex. http://codex.wordpress.org/Author_Templates <?php get_header(); ?> <div id=”content” class=”narrowcolumn”> <!– This sets the $curauth variable –> <?php $curauth = (isset($_GET[‘author_name’])) ? get_user_by(‘slug’, $author_name) : get_userdata(intval($author)); ?> <h2>About: <?php echo $curauth->nickname; ?></h2> <dl> <dt>Website</dt> <dd><a href=”https://wordpress.stackexchange.com/questions/157033/<?php echo $curauth->user_url; ?>”><?php echo $curauth->user_url; ?></a></dd> <dt>Profile</dt> <dd><?php … Read more

Change an option string to a function [closed]

To do something like that, you would most likely have to use eval() on the text provided … which is a really bad idea. You would be much better off providing a list of check boxes that have different values so the user can choose which items to show your sidebar on. For example: <input … Read more

get_avatar from user id

To display users with specific ID’s on a page you’ll need to run a WP_User_Query, either by placing the following code in your functions.php and calling it with a shortcode or adding it to the page template: //Replace the numbers 1, 2 with the user ID’s to return $args = array( ‘include’ => array( 1, … Read more

Product Category Page in Full Width

I will explain it to you without code at the moment, but in things need to be done: Before you render your category html, check its position (depth) from its current category upwards to the parent category. If the level is 2, then add the style you want to post_class (post_class($array)), otherwise do not add. … Read more

Code working in functions.php but not pluign for gavity forms

Put the add_filter() call in the init function: public function init(){ parent::init(); add_filter(“gform_submit_button”, array($this, “form_submit_button”), 10, 2); add_filter(“gform_confirmation”, array( $this, ‘custom_confirmation’ ), 10, 4 ); } And then add your custom_confirmation() function as a method to the class: class GFSimpleAddOn extends GFAddOn { /* all the other properties and methods */ public function custom_confirmation($confirmation, $form, … Read more

Custom archives page by month and year – nesting problem

After much more work, I developed a solution that outputs archives by year, month and day while minimising database calls. Posting it here for others to use: //* Add custom archives below entry content add_action( ‘genesis_entry_content’, ‘custom_archives_page_content’ ); function custom_archives_page_content() { global $post; // set post arguments $args = array( ‘posts_per_page’ => -1, ‘orderby’ => … Read more

Parse error: syntax error, unexpected ‘else’ (T_ELSE) [closed]

You aren’t ending your while before doing your else: $args = array( ‘post_type’ => ‘members_features’, ‘posts_per_page’ => 6 ); $the_query = new WP_Query( $args ); ?> <? if ( $the_query->have_posts() ) : ?> <? while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h2><? the_title(); ?></h2> <div class=”entry-content”> <? the_content(); ?> </div> <? wp_reset_postdata(); ?> <?php /** … Read more