Hello..
I want to make my links visible only on home page.I have two link categories (Links and Friends), but for now i'm using only second(friends).
Do i need to remove links widget or to leave it on a sidebar?I tried both, and nothing..
I use this code
<?php if(is_home() && !is_paged()) : ?>
<?php wp_reset_query(); ?>
<?php wp_list_bookmarks('categorize=0'); ?>
<?php endif ?>
Is this OK?
How to make it working?
Thanks
Try:
<?php
if(is_home() && !is_paged()) :
wp_list_bookmarks('categorize=0');
endif ?>
Thanks for the code, but i couldn't make it work.
Tamara.Urry
Member
Posted 1 year ago #
The point of wp_reset_query() is to requery the current page. WPress only allows for one is_home() or is_front_page() type of query per rendering.
If it isn't working that means the query is being used somewhere else when the page is being built.
Place wp_reset_query() above the if statement and you'll be fine.
<?php wp_reset_query(); ?>
<?php if(is_home() && !is_paged()) : ?>
<?php wp_list_bookmarks('categorize=0'); ?>
<?php endif ?>
Tamara.Urry
Member
Posted 1 year ago #
This syntax works.
<?php
wp_reset_query();
if (is_front_page()) {?>
<?php wp_list_bookmarks('categorize=0'); ?>
<?php }?>
Thanks Tamara :)
Thank you very much.
Its working now... finally :) :)