Dot22
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Questions about functions.phpI’ve tried to get it work but it didn’t. The code of the loop in my index.php page is:
<?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php else : ?>Forum: Fixing WordPress
In reply to: Questions about functions.phpThanks for your reply megafreechips. The code must be included inside the loop, right?
Forum: Fixing WordPress
In reply to: Post pagination on index pageHello Jose,
Thanks for your reply. This is the code of my index.php page:
<?php get_header(); ?> <div class="content-path">Some text here</div> <div class="container"><br /> <h2>News</h2> <?php $c = 0; if ( have_posts() ) : ?> <?php query_posts($query_string . '&cat=1'); ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); $c++; ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php if( $c == 2 ) :?> <div style="margin: -50px auto 10px;"><hr /></div> <?php $c = 0; endif;?> <?php endwhile; ?> <?php custom_content_nav( 'nav-below' ); ?> <?php else : ?> <?php if ( current_user_can( 'edit_posts' ) ) : // Show a different message to a logged-in user who can add posts. ?> <div style="text-align: center; font-weight: bold;"><?php _e( 'Nothing found.', 'custom' ); ?></div> <?php else : // Show the default message to everyone else. ?> <div style="text-align: center; font-weight: bold;"><?php _e( 'Nothing found.', 'custom' ); ?></div> <div style="text-align: center; font-weight: bold;"><?php _e( 'Nothing found.', 'custom' ); ?><br /> <?php get_search_form(); ?> </div><!-- .entry-content --> <?php endif; // end current_user_can() check ?> <?php endif; // end have_posts() check ?> <div class="content-path2">More text here</div> <div align="right"><a href="#top">up? <span class="fa fa-arrow-circle-o-up fa-lg"></span></a></div></div> <?php get_footer(); ?>How can I use the is_paged() conditional? Thanks again!
Forum: Plugins
In reply to: [WP Popular Posts] .htaccess, admin-ajax and WP ProtectionThanks for the help Hector! I’m checking with the hosting if there is any restriction or problem regarding .htaccess exception.
If I can solve the problem I’ll update this post with the solution (or at least the cause of the problem). Thanks again, and your plugin is awesome! =)
Forum: Plugins
In reply to: [WP Popular Posts] .htaccess, admin-ajax and WP ProtectionI don’t use any plugin to strength the security of wp-admin folder. Just the .htaccess file. I’ve done a fresh install of WordPress with WordPress Popular Posts only.
The password protection code is only on the wp-admin folder. I have two .htaccess…
Inside /wp-admin folder:
# Allow plugin access to admin-ajax.php around password protection <Files admin-ajax.php> Order allow,deny Allow from all Satisfy any </Files> AuthType Basic AuthName "Admin only" AuthUserFile "/var/www/inesc/data/etc/43109648.passwd" require valid-userOn main WordPress directory:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPressThe result: all the pages on the front-side of the site (except index.php) are asking for a user/pass. Thanks again for all the help and replies!
Forum: Plugins
In reply to: [WP Popular Posts] .htaccess, admin-ajax and WP ProtectionSadly, the problem persists. I pasted that code on the .htaccess file inside /wp-admin folder and also changed the AuthUserFile path but didn’t work.
The plugin is awesome.. there’s any alternative to continue using it and make WP admin panel more secure?
Forum: Plugins
In reply to: [WP Popular Posts] .htaccess, admin-ajax and WP ProtectionThanks again for the answer but it didn’t work… The front-end site continue asking for a user/pass on all the pages except index.php =(
Forum: Plugins
In reply to: [WP Popular Posts] .htaccess, admin-ajax and WP ProtectionActually this is the code of my .htaccess file…
AuthType Basic AuthName "/www/path/wp-admin/" AuthUserFile /var/path/43109648.passwd <Limit GET POST> require valid-user </Limit> <Files admin-ajax.php> Order allow,deny Allow from all Satisfy any </Files>But it didn’t work. The front-end side of the site continue asking for username and password. Maybe the .htaccess ignores the exception?
Forum: Fixing WordPress
In reply to: How to show all posts inside top parent category?I found the solution. After looking the code again and again, added…
$cat_id = $category2->term_id;behind foreach echo. So the code I’ve now is:
<?php $args = array ( 'orderby' => 'id', 'order' => 'DESC', 'number' => 1, 'parent' => 0 ); $categories = get_categories( $args ); foreach ( $categories as $category ) { $args2 = array ( 'child_of' => $category->term_id ); $categories2 = get_categories( $args2 ); foreach ( $categories2 as $category2 ) { echo "top 3 posts in: $category2->slug"; $cat_id = $category2->term_id; $latest_cat_post = new WP_Query ( array ( 'posts_per_page' => 3, 'category__in' => array( $cat_id) ) ); if( $latest_cat_post->have_posts() ) : while( $latest_cat_post->have_posts() ) : $latest_cat_post->the_post(); ?> <h1><?php the_title(); ?></h1> <?php endwhile; endif; } } ?>Thanks very much for all the help shadez! =D
Forum: Fixing WordPress
In reply to: How to show all posts inside top parent category?I’ve checked the posts again and they aren’t assigned to both subcategories. Maybe with a real example I can explain this better. I have two Categories (1 and 2) and the code get the posts inside category 2 succesfully. But inside category 2 I have subcategories… for example: Letters & Numbers.
I want to display all the posts from Letters, and so on. Inside each subcategory I’ve two posts in this order…
Post 4 – Letters
Post 3 – Numbers
Post 2 – Numbers
Post 1 – LettersThe last piece of code gives me this result:
Subcategory: Letters
Post 4 | Post 3 | Post 2Subcategory: Numbers
Post 4 | Post 3 | Post 2and really I want to show:
Subcategory: Letters
Post 4 | Post 1Subcategory: Numbers
Post 3 | Post 2Thanks again and excuse me if I’m not very clear.. =(
Forum: Fixing WordPress
In reply to: How to show all posts inside top parent category?Thanks again for the reply! =) I’ve tried with the new code, but now it lists the same last three posts from each subcategory or slug. I mean…
Category 3
– Subcategory A
Post 4 | Post 3 | Post 2
– Subcategory B
Post 4 | Post 3 | Post 2I’m trying to make it works, but hasn’t had any results yet.
Forum: Fixing WordPress
In reply to: How to show all posts inside top parent category?Thank you a lot shadez! Works really great! =)
One more question: Is there a way to display all the posts on the same subcategory next to each other? Like this:
Category 1
-Subcategory 1
Post | Post | Post
-Subcategory 2
Post | Post | PostThanks again!