Using Switch Statement to Change Image According to Last Digit of Topic ID

I would try something like this: function bg_image_topic_titlearea() { if ( ! function_exists( ‘bbp_get_topic_id’ ) ) { return false; } if ( ! $letztezifferimgs = bbp_get_topic_id() ) { return false; } $letztezifferimgs = substr( $letztezifferimgs, – 1 ); // switch … return true; } I would recommend checking to make sure the function call (bbp_get_topic_id();) … Read more

Pass post title as URL parameter

I think adding the new link by hook will be the best way. function new_nav_menu_items($items) { global $post; $post_slug=$post->post_name; $landinglink = ‘<li class=”home”><a href=”‘ .get_page_link(‘YOUR_LANDING_PAGE_ID_HERE’).’?from=’.$post_slug.'”>’ . __(‘BLAA’) . ‘</a></li>’; $items = $items . $landinglink; return $items; } add_filter( ‘wp_nav_menu_items’, ‘new_nav_menu_items’ ); Change ‘YOUR_LANDING_PAGE_ID_HERE’ with landing page ID. Cheers

WordPress website giving 404

Please try this .htaccess. <IfModule mod_rewrite.c> RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L]

My website has some Crawling Errors?

This can be the case when you heave ‘deadlinks’ or broken links at one of your pages. You can try submitting a sitemap of your site. There are several plugins that can generate a sitemap for you. I can recommend Yoast SEO. Then just submit your sitemap URL at Google Webmaster tools. You can also … Read more

Custom Taxonomy Theme file not routing correctly

The template isn’t determined by the URL, it’s taxonom-{taxonomy_slug}.php See here for the full template hierarchy: https://developer.wordpress.org/themes/basics/template-hierarchy/ And a visual representation: https://wphierarchy.com/ Final Note on Terminology There’s a difference between taxonomies and terms, and muddling the two words or always referring to them as taxonomies will get confusing very quickly. For example ‘accounts’ would be … Read more

Unwanted URL with Custom Post Type

function rt_custom_post() { register_post_type( ‘book’, array( ‘labels’ => array( ‘name’ => __( ‘Books’ ), ‘singular_name’ => __( ‘Book’ ), ), ‘public’ => true, ‘has_archive’ => false, //this will eliminate the archive page ‘supports’ => array(‘title’,’editor’,’thumbnail’), ‘publicly_queryable’ => true ) ); if you add : ‘has_archive’ => false, to your register post type, it will remove … Read more

How to pass a more variable with page/subpage in Wordprees URL?

function add_custom_query_var( $vars ){ $vars[] = “q”; return $vars; } add_filter( ‘query_vars’, ‘add_custom_query_var’ ); mydomain/how-we-work/our-process/?q=more-value You can handle it with get_query_var( ‘q’ ); Edit1: If you want to use with ‘SEO URL’ you need to add_rewrite_rule function add_rewrites(){ add_rewrite_rule( ‘^how-we-work/our-process/([^/]*)/?’, ‘index.php?pagename=how-we-work/our-process&q=$matches[2]’, ‘top’ ); } add_action( ‘init’, ‘add_rewrites’ );

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