grezliq
Forum Replies Created
Viewing 6 replies - 1 through 6 (of 6 total)
-
Forum: Fixing WordPress
In reply to: Category shows wrong postsI deleted it. It’s ok now.
Thank you so much.
Forum: Fixing WordPress
In reply to: Category shows wrong postsOk I think I know what’s wrong, but don’t know how to fix it:
As we can see, there’s a code in category template:
/* Run the loop for the category page to output the posts. * If you want to overload this in a child theme then include a file * called loop-category.php and that will be used instead. */ get_template_part( 'loop', 'category' ); ?>
And we look into loop.php:
<?php /* Start the Loop. * * In Twenty Ten we use the same loop in multiple contexts. * It is broken into three main parts: when we're displaying * posts that are in the gallery category, when we're displaying * posts in the asides category, and finally all other posts. * * Additionally, we sometimes check for whether we are on an * archive page, a search page, etc., allowing for small differences * in the loop on each template without actually duplicating * the rest of the loop that is shared. * * Without further ado, the loop: */ ?> <?php $i = 0; ?> <?php query_posts($query_string . '&cat=1'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="blog-left"> <?php if($i%2!=0) { ?> <div class="post"> <?php $photo = array(get_the_post_thumbnail( $post->ID, 'blog_photo')) ;?> ...
So we can see that if I open any category, it shows posts from category id=1.
How to change it? I have two categories in menu, both of them shows posts from category id=1… I would like to fix it.
Forum: Fixing WordPress
In reply to: Adding div to post in specific categoryyou’re cool, thanks ??
Forum: Fixing WordPress
In reply to: Category shows wrong postscategory :
<?php /** * The template for displaying Category Archive pages. * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ get_header(); ?> <div class="page_img"> <?php if ( has_post_thumbnail(6)) { $image = get_the_post_thumbnail( 6 , 'page_photo' ); echo $image; } ?> </div> <div class="page_content"> <h1 class="page-title"><?php printf( __( '%s', 'twentyten' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1> <?php $category_description = category_description(); if ( ! empty( $category_description ) ) echo '<div class="archive-meta">' . $category_description . '</div>'; /* Run the loop for the category page to output the posts. * If you want to overload this in a child theme then include a file * called loop-category.php and that will be used instead. */ get_template_part( 'loop', 'category' ); ?> </div><!-- #content --> <?php get_footer(); ?>
Archive:
<?php /** * The template for displaying Archive pages. * * Used to display archive-type pages if nothing more specific matches a query. * For example, puts together date-based pages if no date.php file exists. * * Learn more: https://codex.www.ads-software.com/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ get_header(); ?> <div id="container"> <div id="content" role="main"> <?php /* Queue the first post, that way we know * what date we're dealing with (if that is the case). * * We reset this later so we can run the loop * properly with a call to rewind_posts(). */ if ( have_posts() ) the_post(); ?> <h1 class="page-title"> <?php if ( is_day() ) : ?> <?php printf( __( 'Daily Archives: <span>%s</span>', 'twentyten' ), get_the_date() ); ?> <?php elseif ( is_month() ) : ?> <?php printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyten' ) ) ); ?> <?php elseif ( is_year() ) : ?> <?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyten' ) ) ); ?> <?php else : ?> <?php _e( 'Blog Archives', 'twentyten' ); ?> <?php endif; ?> </h1> <?php /* Since we called the_post() above, we need to * rewind the loop back to the beginning that way * we can run the loop properly, in full. */ rewind_posts(); /* Run the loop for the archives page to output the posts. * If you want to overload this in a child theme then include a file * called loop-archive.php and that will be used instead. */ get_template_part( 'loop', 'archive' ); ?> </div><!-- #content --> </div><!-- #container --> <?php get_sidebar(); ?> <?php get_footer(); ?>
Forum: Plugins
In reply to: [Form Manager] [Plugin: WordPress Form Manager] Adding image to the postcould you give me a full code to paste to WP?
Forum: Plugins
In reply to: [Form Manager] [Plugin: WordPress Form Manager] get image into templateGuys, I’m newbie in this kind of trics, so I would like to get some help.
<?php /* Template Name: Form Manager Default Template Description: The default template for e-mail notifications and summaries Template Type: email, summary ////////////////////////////////////////////////////////////////////////////////////////// Below are the functions that can be used within a summary template: fm_summary_the_title() - the title of the form fm_summary_have_items() - works like have_posts() for wordpress themes. Returns 'true' if there are more items left in the form. fm_summary_the_item() - works like the_item() for wordpress themes. Initializes the current form item. fm_summary_the_label() - label of the current form item fm_summary_the_type() - type of the current form item (text, textarea, checkbox, custom_list, note, separator, recaptcha, file) fm_summary_has_data() - returns true if the form element is a data element (as opposed to a separator, note, etc.) fm_summary_the_value() - submitted value of the current form item fm_summary_the_timestamp() - timestamp for the current submission fm_summary_the_user() - the login name for the current user. If no user is logged in, this returns an empty string. fm_summary_the_IP() - the IP address of the user who submitted the form. fm_summary_the_nickname() - the current item's nickname fm_summary_get_item_label($nickname) - get an item's label by nickname fm_summary_get_item_value($nickname) - get an item's value by nickname *NOTE: 'Summary' templates can also be used for e-mails. Notice that under 'Template Type', both 'email' and 'summary' are listed. If you want to make a template for e-mail notifications only, then you should only put 'email' under 'Template Type'. ////////////////////////////////////////////////////////////////////////////////////////// */ ?> <?php /* The title of the form */ ?> <?php /* The user's first and last name, if there is a logged in user */ ?> <?php /* The code below displays each form element, in order, along with the submitted data. */ ?> <ul id="fm-summary"> <?php while(fm_summary_have_items()): fm_summary_the_item(); ?> <?php if(fm_summary_the_type() == 'separator'): ?> <hr /> <?php elseif(fm_summary_has_data()): ?> <li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_the_label();?>: <strong><?php echo fm_summary_the_value();?></strong></li> <?php endif; ?> <?php endwhile; ?> </ul>
This is my fm-summary-default.php
Where I have to paste this code and what is ‘whatever’?
Viewing 6 replies - 1 through 6 (of 6 total)