Pages not using permalink

If you’re getting Index of /blog Apache Server Port 80 instead of a 404 page, you might be having a folder called blog in on your server. Try deleting or renaming that folder if you’re not using it. EDIT: Here is a related question: WP Page and Subdirectory with same name

Create posts under certain page

You can assign any page– “Page”, not blog post or CPT post/page– to be the “blog posts” page by going to wp-admin->Settings->Reading, clicking the “A static page” radio box and selecting a static home page and blog page from the drop down menus. If that isn’t what you want, or if that doesn’t work, then … Read more

Secure Pages Best Practice

Not sure about the best practices, but I have a few custom login-sensitive pages which simply display a message if user is not logged and is trying to view the page directly: $logged_in = is_user_logged_in(); if($logged_in) { ?> <article id=”post”> <?php the_content(); ?> </article> <?php } else { _e(‘You are not logged in. Please ‘, … Read more

Hard coded main navigation

STYLING With a static navigation, the CSS you mentioned, won’t work. Use the simple HTML parameters: #access a:link, #access a:active, #access a:visited{ font-weight: bold; } CODING In my project, I used echo get_the_category_by_ID( 11 ); to echo the Category name of the cat_ID = 11. You can show the cat name by this. For page … Read more

Pull Random Attachments With Pagination

Your since83_pagination() function is assuming the main query– $wp_query— but you are needing to paginate something very different. You need to be paginating the results in $attachments which you are retrieving with get_children(). That was my guess as soon as I saw this question. You are going to need to rethink this. There are two … Read more

How to setcookie if is_page(‘page’) ? should I use add_action(‘init’) or there is another action?

template_redirect and wp (as the OP noted in comments) are good hooks to do this. But there’s a problem of logic in the sample code. I think it should be like: add_action( ‘template_redirect’, ‘cookie_redirect_wpse_113662’ ); function cookie_redirect_wpse_113662() { # No cookie set, let’s do it if( !isset( $_COOKIE[‘site_language’] ) ) set_cookie_wpse_113662( ‘ar’ ); # One … Read more