Custom walker with hashes instead of links (one-page layout)

Well, after some more intense research I finally found a viable solution that is clean and simple and works flawless so far. Just put this into your functions.php to create a custom walker which turns classic permalinks into hashes (e.g. page.com/mypage to page.com/#mypage): /* Custom nav walker */ class Single_Page_Walker extends Walker_Nav_Menu{ function start_el(&$output, $item, … Read more

Categories vs. Page Site Organization

You could create a customised ‘landing page’ using a template file? Creating category-internal.php with custom layout would display content at the /category/internal/ url. Here is some more info: https://codex.wordpress.org/Category_Templates http://www.wpbeginner.com/wp-themes/how-to-create-category-templates-in-wordpress/

How to modify the slug for the default wp posts without affecting other posttypes?

According to the docs: https://codex.wordpress.org/Using_Permalinks Go to settings -> permalinks -> custom structure and change that to: /blog/%postname%/ But please make sure that in your custom post types definition, (register_post_type) set ‘rewrite’ => array( ‘with_front’ => false ), unless the URL of all of your custom post types will be prefixed by /blog/ UPDATE: As … Read more

Custom page slug without creating a WP page

You’re close, the query var for passing page slug is pagename: add_filter(‘query_vars’, ‘add_account_edit_var’, 0, 1); function add_account_edit_var($vars){ $vars[] = ‘account-edit’; return $vars; } add_action( ‘init’, ‘add_account_edit_rule’ ); function add_account_edit_rule() { add_rewrite_rule( ‘^my-account/([^/]*)/?’, ‘index.php?pagename=my-account&account-edit’, ‘top’ ); } To capture the value in your rule, you need to pass the value in $matches[1]: add_rewrite_rule( ‘^my-account/([^/]*)/?’, ‘index.php?pagename=my-account&account-edit=$matches[1]’, ‘top’ … Read more

How to remove slugs from multiple custom post types

Looks like you have your if doing the opposite of what you want. You’re returning the unaltered link if you’re on ‘furniture-type’ or ‘pop-tags’. This should work: function hf_remove_slug( $post_link, $post, $leavename ) { if((‘pop-tags’ == $post->post_type || ‘furniture-type’ == $post->post_type) && ‘publish’ == $post->post_status) { $post_link = str_replace( “https://wordpress.stackexchange.com/” . $post->post_type . “https://wordpress.stackexchange.com/”, “https://wordpress.stackexchange.com/”, … Read more

Using page slug in array

In your tax query, you’re searching for a string instead of a variable, the only time it will match currently is if the term is literally “$page_slug”. You should remove the single quotes around the $page_slug to have it parsed as a variable, so: ‘terms’ => ‘$page_slug’ should be: ‘terms’ => $page_slug,

Changing search slug from + to – (hyphen)

PHP’s urlencode() function replaces spaces with +s, so that’s why that’s happening for you. WordPress provides the sanitize_title() function, which is used (among other things) to generate a post slug from the post’s title. /** * Change search page slug. */ function wp_change_search_url() { if ( is_search() && ! empty( $_GET[‘s’] ) ) { wp_redirect( … Read more

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