ziont
Forum Replies Created
-
@esmi: worked just fine, for my first coloumn.
I managed to replicate your code for other 2 columns too and added ‘posts_per_page’ => 5 so I can display 5 posts/page and works great!So, my final working code for displaying posts on my homepage blog in 3 coloumns (each with 3 different categories and 5 posts/category) is:
<div id="content_left"> <div class="category"> <h3 class="category_header">Web news</h3> </div> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args= array( 'cat' => '=26', 'posts_per_page' => 5, 'paged' => $paged ); query_posts($args); if (have_posts()) : while (have_posts()) : the_post(); ?> <article <?php post_class() ?> id="post-<?php the_ID(); ?>" itemscope itemtype="https://schema.org/Article"> <h2 class="entry-title"> <a>"> <span itemprop="name"><?php the_title(); ?> </span></a></h2> <?php posted_on(); ?> <div class="entry" > <span itemprop="articleSection"> <?php the_content('(Full story →)'); ?> </span> </div> <footer class="postmetadata"> <?php the_tags(__('Subiecte: ','html5reset'), ', ', ''); ?> <?php _e('Category: ','html5reset'); ?> <?php the_category(', ') ?> <?php _e('Reactions: ','html5reset'); ?><?php comments_popup_link(__('0 Comments ?','html5reset'), __('1 comment ?','html5reset'), __('% Comments ?','html5reset')); ?> </footer> </article> <?php endwhile; ?> <?php else : ?> <h2><?php _e('Nothing Found','html5reset'); ?></h2> <?php endif; ?> </div> <div id="content_middle"> <div class="category"> <h3 class="category_header">Tests</h3> </div> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args= array( 'cat' => '=21', 'posts_per_page' => 5, 'paged' => $paged ); query_posts($args); if (have_posts()) : while (have_posts()) : the_post(); ?> <article <?php post_class() ?> id="post-<?php the_ID(); ?>" itemscope itemtype="https://schema.org/Article"> <h2 class="entry-title"> <a>"> <span itemprop="name"><?php the_title(); ?> </span></a></h2> <?php posted_on(); ?> <div class="entry" > <span itemprop="articleSection"> <?php the_content('(Full story →)'); ?> </span> </div> <footer class="postmetadata"> <?php the_tags(__('Subiecte: ','html5reset'), ', ', ''); ?> <?php _e('Category: ','html5reset'); ?> <?php the_category(', ') ?> <?php _e('Reactions: ','html5reset'); ?><?php comments_popup_link(__('0 Comments ?','html5reset'), __('1 comment ?','html5reset'), __('% Comments ?','html5reset')); ?> </footer> </article> <?php endwhile; ?> <?php else : ?> <h2><?php _e('Nothing Found','html5reset'); ?></h2> <?php endif; ?> </div> <div id="content_right"> <div class="category"> <h3 class="category_header">Recommendations</h3> </div> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args= array( 'cat' => '=374', 'posts_per_page' => 5, 'paged' => $paged ); query_posts($args); if (have_posts()) : while (have_posts()) : the_post(); ?> <article <?php post_class() ?> id="post-<?php the_ID(); ?>" itemscope itemtype="https://schema.org/Article"> <h2 class="entry-title"> <a>"> <span itemprop="name"><?php the_title(); ?> </span></a></h2> <?php posted_on(); ?> <div class="entry" > <span itemprop="articleSection"> <?php the_content('(Full story →)'); ?> </span> </div> <footer class="postmetadata"> <?php the_tags(__('Subiecte: ','html5reset'), ', ', ''); ?> <?php _e('Category: ','html5reset'); ?> <?php the_category(', ') ?> <?php _e('Reactions: ','html5reset'); ?><?php comments_popup_link(__('0 Comments ?','html5reset'), __('1 comment ?','html5reset'), __('% Comments ?','html5reset')); ?> </footer> </article> <?php endwhile; ?> <?php else : ?> <h2><?php _e('Nothing Found','html5reset'); ?></h2> <?php endif; ?> </div> <div align="center"> <?php post_navigation(); ?></div> <?php get_footer(); ?>
Thank you again, @esmi.
Forum: Themes and Templates
In reply to: [Simple Catch] how to translate Simple CatchCould you expand a little more, on that? Simply edited and uploaded to the LANG folder, or…how?
Did you have to preserve the “simplecath.po” name?
Forum: Fixing WordPress
In reply to: WordPress will not publish if I mention the word TorrentIs it really possible? I mean, can they do that with software?
Forum: Themes and Templates
In reply to: Sandbox theme – sidebar positioningBecause of the forum rules, here’s the demo URL.
Could someone, please take a look at it. Thank you.
Forum: Fixing WordPress
In reply to: How to re-attach images, tags and categories?Ok. I found someone that had the same problem. He got this script:
DROP PROCEDURE
udsp_RepairImages`//
CREATE DEFINER=user
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;
DECLARE _attach_guid VARCHAR(255);
DECLARE _parent_id BIGINT DEFAULT 0;
DECLARE _done INT DEFAULT 0;BEGIN
DECLARE cur_attach CURSOR FOR SELECT ID, guid FROM wp_posts WHERE post_parent = 0 AND post_type = ‘attachment’;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET _done = 1;
OPEN cur_attach;REPEAT
FETCH cur_attach INTO _attach_id, _attach_guid;IF (_done = 0) THEN
SELECT ID INTO _parent_id FROM wp_posts WHERE post_content LIKE CONCAT(‘%’, _attach_guid, ‘%’) AND post_type = ‘post’ LIMIT 0,1;IF (_parent_id IS NOT NULL) THEN
UPDATE wp_posts SET post_parent = _parent_id WHERE ID = _attach_id AND post_type = ‘attachment’; END IF;
SET _done = 0;END IF;
UNTIL (_done = 1)
END REPEAT;
CLOSE cur_attach;
SET _done = 0;
END;
END`
But when I run it into information_schema, on my local phpmyadmin, I get this error:There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem
ERROR: Unknown Punctuation String @ 35
STR: //
SQL: DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;DROP PROCEDUREudsp_RepairImages
//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
DECLARE _attach_id BIGINT DEFAULT 0;SQL query:
DROP PROCEDURE
udsp_RepairImages
// CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
() BEGIN DECLARE _attach_id BIGINT DEFAULT 0;MySQL said:
#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘//
CREATE DEFINER=root
@localhost
PROCEDUREudsp_RepairImages
()
BEGIN
‘ at line 1I assumed, it was something wrong with the “quotes” so I’ve changed them. Somehow, no luck. Maybe I’m not using the right “quotes”.
Pfff… My blog is offline and I’ve been trying for 2 days straight now and I can’t seem to make all these things work at all.
Forum: Fixing WordPress
In reply to: How to re-attach images, tags and categories?Yes, same domain. And like I said, I’m getting a white page on my blog and I looked it up on the Internet and it’s called “white wordpress page” or “wordpress black death screen”. Anyway, because of this error, I’m not able to export. I know all about the XML file but I just can’t log in since the entire blog is… white.
I just need to know how can I re-attach images, categories and tags back on.
Here’s how my database looked like.
The tables without “neo” prefix have been created due to WordPress updates along the year.I have renamed them to simple “wp_” and deleted the unneccesary tables and here’s what I’ve got so far.
What else do I need to change? How am I supposed to re-attach pictures, tags and categories to posts?
Thank you.
Got it. Here’s the final code:
<?php if(function_exists('get_avatar')) { if(validate_gravatar($comment->comment_author_email)){ echo get_avatar($comment, '80'); } else { echo get_avatar($comment, '80'); echo '<div style="margin-left: 20px;"> <a href="https://yourblog/minitutorial" title="How">(How?)</a> </div>'; } } ?>
Thanks a lot, guys. Really appreciate your efforts. Thank you so much.
Ok. I have copied the function above in my functions.php (thanks keesiemeijer) and here’s how I tried to validate and display a link for those who don’t have a Gravatar account while displaying my Default Gravatars:
<?php if(function_exists('get_avatar')) { echo get_avatar($comment, '80'); } if(function_exists('validate_gravatar')) { echo '<div style="margin-left: 20px;"> <a href="myblogurl/miniturorial" title="How">(How?)</a> </div>'; } ?>
Except that it shows this custom link to all the users, both those who HAVE GRAVATARS and those WHO HAVEN’T.
What else am I supposed to do display the link under the users who DON’T have a Gravatar account?
@ipstenu I would like to have my default gravatars untouched, I mean, with no directions and that kind of stuff. It would look nicer if I had a message under the picture.
Forum: Fixing WordPress
In reply to: [Plugin: Simple Tags] Display number of posts for each tag in a listSo, no one?
Forum: Fixing WordPress
In reply to: Category to Tags Converter – missing in 2.7?I would like an answer to this one too.
Forum: Fixing WordPress
In reply to: brining back to life a blog – database backupThat’s not so confortable figaro. I can think for one reason: I don’t know you…
Forum: Fixing WordPress
In reply to: brining back to life a blog – database backupThanks figaro but it’s not helping.
I have changed my server, ok? But I do have my blog database backp (generated by the plugin database backup).Now, I don’t know how to bring to life my blog since I’ve tried every combination i could think of…
What else can I do? Please, It would mean a lot to me!
Forum: Fixing WordPress
In reply to: brining back to life a blog – database backup… I get the same problem with 2.7. What can I do now?
OK. Let’s start over.
1. My subdomain blog is empty. I restored my old database backup.
2. I’ve uploaded the 2.7 wp admin files.
3. I have replaced the new wp-config file with my old one.
4. I still get an error on my homepage “NOT FOUND” and it seems like my user admin does not exist.
WHAT CAN I DO NOW?Forum: Fixing WordPress
In reply to: brining back to life a blog – database backupI feel like I’m going insane… I’ve searched through this forum and got 81 results and none of them fixed my problem…