get permalink and append it

Well, succinctly you could just add ‘-book’ to your link, if your permalink settings result in post-name slugs: <a href=”https://wordpress.stackexchange.com/questions/210589/<?php echo untrailingslashit( get_the_permalink() ); ?>-book/”>Book Now</a> However if you’re not very careful, or are planning on running a site with a large number of content or with several people having access to the dashboard – … Read more

Custom theme navigation

1. Register your menu Register your menu with register_nav_menus() after which you can choose that menu from admin area: Appearance -> Menus. Add one of these to functions.php: <?php register_nav_menus( array( ‘primary’ => __( ‘Main Menu’, ‘tt’ ) ) ); //’primary’ is basically like a slug that can be used to get that specific menu … Read more

WordPress Permalink 404

Change your form fields to have more unique names, specifically, title. This is an issue which was introduced when title was made a public query var in 4.4. This is seen as a bug, and will eventually be fixed, but it’s always safer to prepend any vars with a unique string to prevent these problems.

How to have extra permalink for posts

You can always use the post ID to link to a page, like this: http://yourdomain.tld/?p=1234 You can find out the Post ID right from the post overview screen. If you hover over the “Edit” or “Delete” link, you can see that the URL has a parameter post=. The number behind that is your page ID. … Read more

How to stop WordPress from removing & from URL?

Here’s the why part: This part of the redirect_canonical() is removing the leading & in the redirect query part: // tack on any additional query vars $redirect[‘query’] = preg_replace( ‘#^\??&*?#’, ”, $redirect[‘query’] ); Example: example.tld/?&a=1&b=2&c=3 is redirected to example.tld/?a=1&b=2&c=3 If you must have the leading & you might try to adjust it through the redirect_canonical … Read more

Pagination Issue – /page/2 404

Pieter was correct. It was messing up due to the custom loop I was running on the archive page. I removed the custom loop, and then adjusted the arguments with pre_get_posts. The strange thing was that, to test if it was this issue, running a custom loop on an archive page was the issue, I … Read more

Server Move: All pages leading home

Your proxy is rewriting everything to index.php, which means that the backend never sees the original URI. The proxy should be transparent, like this: server { listen 80; server_name example.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:8080; } }

Custom Permalink

The custom rule you are trying doesn’t meet the criteria. Here’s a nifty online .htaccess tester tool to see to check rewrite logic. Use the follow RewriteRule instead: RewriteCond %{QUERY_STRING} (^|&)name=(.*) RewriteRule ^(.*)$ /profile/%2/? [R=301,L] Be sure to replace ^example\.com$ on the first line with your actual domain. You can also embed it in the … Read more

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