edwire
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to display random posts from a given category?Hi iv.dimova, thank you for all your help. Finally I got everything working.
thanks again
Ed
PS I’ve added a code to change the size of the excerpt and it works!
Forum: Fixing WordPress
In reply to: How to display random posts from a given category?I’ve put the: <?php the_content();?> it’s showing the whole post I only want to be able to show 4 to 6 lines of the actual content.
Ed
Forum: Fixing WordPress
In reply to: How to display random posts from a given category?sorry I was getting an infinite loop, now I’ve put the code below everything and now is loading properly.
I only want to show the title and 4 to 6 lines of text. how do I do that?
thanks again
Ed
Forum: Fixing WordPress
In reply to: How to display random posts from a given category?Don’t worry I got it going now.
thank you
Ed
Forum: Fixing WordPress
In reply to: How to display random posts from a given category?Hi, it is working but it is looping indefinetly is creating hundreds of links see my page sample:
https://mireciclarte.com/test/
Ed
Forum: Fixing WordPress
In reply to: How to display random posts from a given category?Now it is finally working!
thank you so much!
How good are in php? I need to modify a script to fit my needs. I’ll compensate for any work done.
you’re great!
Ed
PS Why not come to Peru and Brazil? let me know if ever come this way.
Forum: Fixing WordPress
In reply to: How to display random posts from a given category?I’m getting syntax error:
this what I’m adding to my template:
hp query_posts(array(
‘showposts’ => 6,
‘orderby’ => ‘rand’,
‘category_name’ => ‘new’ //You can insert any category name
));
if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php endwhile; ?>
<?php endif; ?>Ed
Forum: Fixing WordPress
In reply to: How to display random posts from a given category?If you ever come to Peru I’ll treat you to Machu Picchu! thank you so much for your help.
I’m going to try right now.
Ed
Forum: Fixing WordPress
In reply to: How to display random posts from a given category?Hi iv, I don’t know if I was clear enough. All I need is to be able to create a post and at the footer of the post have an excerpt from another post like in this example:
Jorge Win the Loterry (Title)
description:
asd asd as as d asd a sd as d as d asd a sdadada as d a
aasd a sd a sd a sd a da sd asd adadsas
asdasd asd aasd a sd a sd a sd a da sd asd adadsas
asdasd asdaasd a sd a sd a sd a da sd asd adadsas
asdasd asdhere at the end of the post have an excerpt from another post:
Breaking News:
The palace was hit today (title excerpt)description excerpt, no more then 4 lines
Forum: Fixing WordPress
In reply to: How to display random posts from a given category?Actually what I need is as follows, I want o be able to create a post and at the bottom of the port I want put let’s say 3 categories.
thank you for your help.
Ed
PS I’m in Peru and wordpress help is almost zero
Forum: Fixing WordPress
In reply to: How to display random posts from a given category?I’m sorry that was the wrong template, here is my template:
<?php
/*
* This file is a template part
* produces WordPress Loop for use in single.php
* moved to theme root from contents folder @since version 2.6
*
*/$ka_blogtitle = get_option(‘ka_blogtitle’);
$ka_searchbar = get_option(‘ka_searchbar’);
$ka_crumbs = get_option(‘ka_crumbs’);
$ka_blogbutton = get_option(‘ka_blogbutton’);
$ka_blogauthor = get_option(‘ka_blogauthor’);
$ka_related_posts = get_option(‘ka_related_posts’);
$ka_related_posts_title = get_option(‘ka_related_posts_title’);
$ka_related_posts_count = get_option(‘ka_related_posts_count’);
$ka_posted_by = get_option(‘ka_posted_by’);
$ka_post_date = get_option(‘ka_post_date’);
if ($ka_post_date != “false”){ $ka_post_date_result = ‘style=”background:none !important;”‘;}else{$ka_post_date_result = ”;}
$ka_dragshare = get_option(‘ka_dragshare’);
$blog_image_frame = get_option(‘ka_blog_image_frame’);if (have_posts()) : while (have_posts()) : the_post();
//retrieve all post meta of posts in the loop.$linkpost = get_post_meta($post->ID, “_jcycle_url_value”, $single = true);
$external_image_url = get_post_meta($post->ID,’truethemes_external_image_url’,true);
$video_url = get_post_meta($post->ID,’truethemes_video_url’,true);
$permalink = get_permalink($post->ID);
//prepare to get image
$thumb = get_post_thumbnail_id();
$image_width = 538;
$image_height = 218;//use truethemes image croping script, function moved to truethemes_framework/global/basic.php
$image_src = truethemes_crop_image($thumb,$external_image_url,$image_width,$image_height);
?><div class=”single_blog_wrap”>
<div class=”post_title”><?php truethemes_begin_single_post_title_hook();// action hook, see truethemes_framework/global/hooks.php ?>
<h2><?php the_title(); ?></h2>
<?php if ($ka_posted_by != “true”) {?><p class=”posted-by-text”><span><?php _e(‘Posted by:’, ‘truethemes_localize’) ?></span> <?php the_author_posts_link(); ?></p><?php }?><?php truethemes_end_single_post_title_hook();// action hook, see truethemes_framework/global/hooks.php ?>
</div><!– end post_title –>
<div class=”post_content” <?php echo $ka_post_date_result; ?>>
<?php truethemes_begin_single_post_content_hook();// action hook, see truethemes_framework/global/hooks.php ?>
<?php
//function to generate internal image, external image or video for content-blog.php, content-blog-single.php, and archive.php
//please find it in truethemes_framework/global/basic.php$html = truethemes_generate_blog_image($image_src,$image_width,$image_height,$blog_image_frame,$linkpost,$permalink,$video_url);
echo $html;
?><?php
the_content();
if(function_exists(‘truethemes_link_pages’)){
//Will always use this function for <!–nextpage–>
//function modified from wp_link_pages() to provide more style class
//so that we can style the page links.
truethemes_link_pages();
}else{
//WordPress default page number links function for <!–nextpage–>
//This is for theme check plugin requirement.
//Do not remove this function checks, but comments can be removed..
wp_link_pages();
}?>
<?php if(function_exists(‘selfserv_shareaholic’)) { selfserv_shareaholic(); } ?>
<?php if ($ka_post_date != “true”): ?>
<div class=”post_date”>
<span class=”day”><?php the_time(‘j’); ?></span><span class=”month”><?php echo strtoupper(get_the_time(‘M’)); ?></span>
</div><!– end post_date –><div class=”post_comments”>
“><span><?php comments_number(‘0’, ‘1’, ‘%’); ?></span>
</div><!– end post_comments –>
<?php endif; ?><?php if ($ka_dragshare == “true”){ echo “Share“; }?>
<?php if ($ka_related_posts == “true”){
echo ‘<br class=”clear” /><br class=”clear” />’;
echo do_shortcode(“[related_posts_content limit=\””.$ka_related_posts_count.”\” title=\””.$ka_related_posts_title.”\”]”);}?>
<?php truethemes_end_single_post_content_hook();// action hook, see truethemes_framework/global/hooks.php ?>
text:
</div><!– end post_content –>
<div class=”post_footer”>
<?php truethemes_begin_single_post_footer_hook();// action hook, see truethemes_framework/global/hooks.php ?>
<div class=”post_cats”><p><span><?php _e(‘Categories:’, ‘truethemes_localize’) ?></span> <?php the_category(‘, ‘); ?></p></div><!– end post_cats –>
<?php if (get_the_tags()) : ?>
<div class=”post_tags”><p><span><?php _e(‘Tags:’, ‘truethemes_localize’) ?></span> <?php the_tags(”, ‘, ‘); ?></p></div><!– end post_tags –>
<?php endif; ?><?php truethemes_end_single_post_footer_hook();// action hook, see truethemes_framework/global/hooks.php ?>
</div><!– end post_footer –>
<?php if ($ka_blogauthor == “true”){ ?>
<div class=”comment-wrap” id=”about-author-wrap”>
<div class=”comment-content”>
<div class=”comment-gravatar”><?php echo get_avatar(get_the_author_meta(’email’),$size=’80’,$default=get_template_directory_uri().’/images/_global/default-grav.jpg’ ); ?>
</div><!– end comment-gravatar –><div class=”comment-text”>
<p class=”comment-author-about”><?php _e(‘About the Author:’, ‘truethemes_localize’) ?></p>
<?php the_author_meta(‘description’); ?>
</div><!– end comment-text –></div><!– end comment-content –>
</div><!– end comment-wrap –>
<?php } else {} ?>
</div><!– end single_blog_wrap –><?php
/*
* Add check on whether to disable comments througout site.
* @since version 2.6 development.
*/
global $ttso;
$show_post_comments = $ttso->ka_post_comments;
if($show_post_comments !=’false’):
comments_template(”, true);
endif;
?><?php endwhile; else: ?>
<h2><?php _e(‘Nothing Found’, ‘truethemes_localize’) ?></h2>
<p><?php _e(‘Sorry, it appears there is no content in this section.’, ‘truethemes_localize’) ?></p>
<?php endif; ?>
<?php if(function_exists(‘wp_pagenavi’)) { wp_pagenavi(); } ?>Forum: Fixing WordPress
In reply to: How to display random posts from a given category?Thank you for answering, Where do I put endwhile and endif?
I need this to display right before the footer.
This my actual template:
<?php
/*
* Utility Panel
* This is a template part
* @since version 1.0
* moved to theme root from contents folder @since version 2.6
*
*/
global $ttso;
$show_tools_panel = $ttso->ka_tools_panel;
?>
<div class=”main-area<?php if($show_tools_panel == ‘false’) {echo ‘ utility-area’;}?>”>
<?php
/*
* Check to display or hide tools panel
* @since version 2.6 development
*/
if($show_tools_panel != ‘false’):
?>
<?php $ka_searchbar = get_option(‘ka_searchbar’);
$ka_crumbs = get_option(‘ka_crumbs’); ?><div class=”tools”>
<div class=”holder”>
<div class=”frame”><?php truethemes_before_article_title_hook();// action hook, see truethemes_framework/global/hooks.php ?>
<?php if ( get_post_meta($post->ID, ‘_pagetitle_value’, true) ) { ?>
<h1><?php echo get_post_meta($post->ID, “_pagetitle_value”, $single = true); ?></h1><?php }else { ?>
<h1><?php if(have_posts()) : while(have_posts()) : the_post(); ?><?php if(!is_attachment()){the_title();} ?><?php endwhile; endif; ?></h1><?php } ?>
<?php if ($ka_searchbar == “true”){get_template_part(‘searchform’,’childtheme’);} ?>
<?php if ($ka_crumbs == “true”){ ?><?php $bc = new simple_breadcrumb; ?><?php } ?><?php truethemes_after_searchform_hook();// action hook, see truethemes_framework/global/hooks.php ?>
</div><!– end frame –>
</div><!– end holder –>
</div><!– end tools –>
<?php endif; ?>Ed