Excerpt all post content Content Same Size without word cutting off

I use wp_trim_words to create multiple excerpts. I always abuse it when I need more than one excerpt length. Here is how function wpse_custom_excerpts($limit) { return wp_trim_words(get_the_excerpt(), $limit, ‘<a href=”‘. esc_url( get_permalink() ) . ‘”>’ . ‘&nbsp;&hellip;’ . __( ‘Read more &nbsp;&raquo;’, ‘wpse’ ) . ‘</a>’); } What this function do is taking get_the_excerpt trimming … Read more

echo vs output variable [closed]

I believe this topic was addressed quite thoroughly here. I might add that within the WordPress community it is common syntax practice to default to echoing tags with an option or alternative/interior function to return the result instead. This I believe is driven by the level of code experience the average user within WordPress has … Read more

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