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

What are trackbacks?

Trackbacks (and their close relatives pingbacks) are rather well documented in Codex under Managing Comments. Essentially it’s a form of automated comment which other sites can use to notify they have something relevant to specific post. Note that just as normal comments these are very heavily spammed and some form of antispam is a must.

Display page contain in index.php file

get_the_content( $more_link_text, $stripteaser ) get_the_content does not take a post ID as a parameter, it always refers to the current post. Also, don’t use magic numbers or hardcode post IDs into your theme, it will break after an import/export or migration. Instead use get_page_by_title, which is not as bad: // get the post $post = … Read more

Load specific page template based on URI

If you can count on the URI always following the same pattern, e.g. /link/###, then you can selectively load a different template using a query variable and a rewrite (will need to flush rewrites to test): /** * Register a query variable to check against for loading a template. * * @param array $vars Registered … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)