Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a problem with my wordpress blog here(http://muraliprashanth.me) everything seems to be working fine but the problem is after each post i am appending author information like the image below
but when i click on the
View all posts by Murali Prashanth hyperlink
it's redirecting me to this URL http://muraliprashanth.me/author/Murali%20Prashanth/
I don't know where to create the author profile page or does my wordpress theme supports author profile pages or not Please suggest me i am struggling to resolve this issue from past 3 months, Help is much appreciated.
Thanks in advance.
These two links have the details about the author profile linking as well as template information. Have a look and see if you are able to fix it.
http://codex.wordpress.org/Author_Templates
http://codex.wordpress.org/Function_Reference/the_author_url
Try it. I 've given my author.php file for usage.
<?php
/**
* The template for displaying Author Archive pages.
*
* #package WordPress
*/
get_header(); ?>
<?php
if ( have_posts() )
the_post();
?>
<h1><?php printf( __( 'Author Archives: %s' ), "<span class='vcard'><a class='url fn n' href='" . get_author_posts_url( get_the_author_meta( 'ID' ) ) . "' title='" . esc_attr( get_the_author() ) . "' rel='me'>" . get_the_author() . "</a></span>" ); ?></h1>
<?php
// If a user has filled out their description, show a bio on their entries.
if ( get_the_author_meta( 'description' ) ) : ?>
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'avatar_size', 60 ) ); ?>
<h2><?php printf( __( 'About %s', 'theme' ), get_the_author() ); ?></h2>
<?php the_author_meta( 'description' ); ?>
<?php endif; ?>
<?php
rewind_posts();
get_template_part( 'loop', 'author' );
?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Related
A client of mine uses a woocommerce webshop and asked me the following: i'm looking for a way to make the emailaddress of the customer in the customer details section of the admin-new-order email, a 'mailto:' link.
UPDATE
With your help so far i've found the correct file to edit (email-customer-details.php), but i'm not quite sure how to edit the file. So far it only states this:
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<h2><?php _e( 'Customer details', 'woocommerce' ); ?></h2>
<ul>
<?php foreach ( $fields as $field ) : ?>
<li><strong><?php echo wp_kses_post( $field['label'] ); ?>:</strong> <span class="text"><?php echo wp_kses_post( $field['value'] ); ?></span></li>
<?php endforeach; ?>
</ul>
The output gives al list with the following:
Customer comment
Customer phonenumber
Customer e-mailadres
You can do that via changing the email-customer-details.php email template that you can find at : /plugins/woocommerce/templates/emails/
Just copy that file into your theme like your-theme/woocommerce/emails/email-customer-details.php and do the changes over there as you need.
Reference link
I'm working on creating a 'Related Articles' feature on my Wordpress site. It uses custom fields where the post author can paste links to related posts that will be displayed at the bottom of the current post. I want to display a thumbnail and a link for each related post.
Problem: get_the_post_thumbnail only works when I provide the ID for the current post. Does anyone have any idea what might be going on here? Here's the code I'm using to generate a related post. I've confirmed that $url, $id, and $title all output as expected.
<?php $url = get_field('url_01'); ?>
<?php $id = url_to_postid($url); ?>
<?php $thumb = get_the_post_thumbnail($id, 'yarpp-thumbnail'); ?>
<?php $title = get_the_title($id); ?>
<?php echo $thumb ?>
<?php echo $title; ?>
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
How to display all pages (different page templates) on one page
for ex : About , portfolio , resume , contact etc in one page
i want to display each page in a div in index.php
this is really simple implementation, add the below code in your index.php
Modify ID for page destiny.
you have create div´s in HTML
<?php $page_id = XXX; //Page ID
$page_data = get_page( $page_id );
//Guardar variáveis
$title = $page_data->post_title;
$content = apply_filters('get_the_content', $page_data->post_content);?>
<div id="box-title">
<div id="titulo-publicidade">
<?php echo $title; //Show title ?>
</div>
<div id="box-content">
<?php echo $content; //Show content ?>
</div>
</div>
Good Luck.
EDIT
I have not tried, but it would be something like this
<?php
$mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc' ) );
foreach( $mypages as $page ) {
$content = $page->post_content;
if ( ! $content ) // Check for empty page
continue;
$content = apply_filters( 'the_content', $content );
?>
<h2><?php echo $page->post_title; ?></h2>
<div class="entry"><?php echo $content; ?></div>
<?php
}
?>
I have created a page template with a nice layout using the lovely custom fields plugin so my client can easily update the content.
I created a loop on that page template that displays the relevant information nicely;
Here is the loop I made:
<?php
$args = array( 'post_type' => 'cripps_staff', 'posts_per_page' => 300 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
echo '<div class="col-md-3 spacetop">';
echo '<a href="'.get_permalink().'">';
echo get_post_meta($post->ID,'image',true);
echo '</a>';
echo '<h2 class="staffname">';
echo get_post_meta($post->ID,'staff_name',true);
echo '</h2>';
echo '<h2 class="staffrole">';
echo get_post_meta($post->ID,'staff_role',true);
echo '</h2>';
echo '<h2 class="staffnumber">';
echo get_post_meta($post->ID,'staff_telephone_number',true);
echo '</h2>';
echo '<h2 class="staffemail">';
echo get_post_meta($post->ID,'staff_email_address',true);
echo '</h2>';
echo '</div>';
endwhile;
?>
I created taxonomies so the staff members are split into categories.
I am then using a plugin called Taxonomies filter to create those dropdown options you will see. When you select an element in the dropdowns, Wordpress goes to/changes the page to a custom search results page I created. I want my search results to be displayed exactly like my loop on the People's template. Currently it just spits it out the title in a h1 tag.
Here is the code I got from the Twenty Fourteen theme:
<?php
// Start the Loop.
while ( have_posts() ) : the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
endwhile;
// Previous/next post navigation.
CrippsTheme_paging_nav();
else :
// If no content, include the "No posts found" template.
get_template_part( 'content', 'none' );
endif;
?>
How can I get the search results to look exactly like my Post loop?
I managed to resolve this completely with the help of Pieter Goosen, who provided me with an awesomely detailed response, see the full answer on Wordpress development forum:
https://wordpress.stackexchange.com/questions/143023/edit-wordpress-loop-taxonomies-filter
Good day everyone, I having this issue with regards to the comments section of my wordpress.org blog. the thing is when my blog got so much comments (around 200+) the comments is pushed down at the bottom of the blog post, until it reaches near the footer. every reader dont want this (me neither).
If any one could help me to edit to re-position the comments box to the top of the comments previously posted. I just want the comments boxes (name, email, website and the comment box) appear first before the comments posted.
It will be much easier for my readers to comments and will also be encouraged to comments.
I don't want to implement the comments pagination because i already tried it and has negative feedback from my readers.
I know its too much to ask to edit those codes below (Im sorry) but I'm not a programmer in nature :( but please kindly help me. I've been reading some tutorials but I cant understand all of them.
my bad.
hope you can help me?
<?php
/**
* The template for displaying Comments.
*
* The area of the page that contains both current comments
* and the comment form. The actual display of comments is
* handled by a callback to twentyten_comment which is
* located in the functions.php file.
*
* #package WordPress
* #subpackage Twenty_Ten
* #since Twenty Ten 1.0
*/
?>
<div id="comments">
<?php if ( post_password_required() ) : ?>
<p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyten' ); ?></p>
</div><!-- #comments -->
<?php
/* Stop the rest of comments.php from being processed,
* but don't kill the script entirely -- we still have
* to fully load the template.
*/
return;
endif;
?>
<?php
// You can start editing here -- including this comment!
?>
<?php if ( have_comments() ) : ?>
<h3 id="comments-title"><?php
printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'twentyten' ),
number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' );
?></h3>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<div class="navigation">
<div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">←</span> Older Comments', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
</div> <!-- .navigation -->
<?php endif; // check for comment navigation ?>
<ol class="commentlist">
<?php
/* Loop through and list the comments. Tell wp_list_comments()
* to use twentyten_comment() to format the comments.
* If you want to overload this in a child theme then you can
* define twentyten_comment() and that will be used instead.
* See twentyten_comment() in twentyten/functions.php for more.
*/
wp_list_comments( array( 'callback' => 'twentyten_comment' ) );
?>
</ol>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<div class="navigation">
<div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">←</span> Older Comments', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
</div><!-- .navigation -->
<?php endif; // check for comment navigation ?>
<?php else : // or, if we don't have comments:
/* If there are no comments and comments are closed,
* let's leave a little note, shall we?
*/
if ( ! comments_open() ) :
?>
<p class="nocomments"><?php _e( '', 'twentyten' ); ?></p>
<?php endif; // end ! comments_open() ?>
<?php endif; // end have_comments() ?>
<?php comment_form(); ?>
</div><!-- #comments -->
the function your looking for is <?php comment_form(); ?> also check the comments.php template and you can edit how there rendered on all posts from one central location.