Add string to wordpress navigation url - wordpress

I'm trying to add google analytics's campaign tracker code to a menu in wordpress. Is there a place in nav-menu-template.php to add a string after the url?
Ex: http://www.page.com?utm_source=SOURCE&utm_medium=MEDIUM&utm_campaign=CAMPAIGN

If you are using a WordPress menu, you can add query strings by using the custom link feature in the Menu section of Admin (Under Appearance => Menus).
Instead of using the page for the menu item, insert your full URL (including query string) in the custom links box and whatever you want for anchor text for the label.
That way you don't have to do something messy like mess with the core files :).

Related

WP Bakery: how to insert dynamic url in Icon element URL (Link) box?

On my website I've a theme that uses WP Bakery. I'm now adding some Icons and I'm running into an issue with the URL (link) setting of the Icon element. (It's the same URL (link) setting as with the Button element.)
Is it possible to use some kind of a shortcode in this URL (link) setting?
For example, I want to make one of the icons a icon to logout but with a correct logout link (so including the wpnonce).
I've already tried a default WP shortcode but I reckon I need to address an WP Bakery function instead... but I can't find the info about that.
Is there anyone who can help me?
In the past I've been creating dynamic URL for the WP menus where I used a construction like /%loginout%/ for the URL, and %loginout% for the label. Is something like this possible within WP Bakery elements?
More info on the Icon and Button elements and the URL (link) can be found on this page: https://kb.wpbakery.com/docs/learning-more/content-elements/ But, so far, that doesn't steer me into any direction at all.

Custom Page Templates in WordPress to show Content in specific layout

I want to create a custom page template in WordPress which shows Image Slideshow and then a video below it and finally some text - till now what I am able to do is play with sidebar, footer, header.
I can either remove them or keep them in my custom page templates but what I want to do is play with the page contents.
The Admin user should be able to see these sections in the Page Editor (WYSIWYG) when they choose the Template from the drop-down, so that they can accordingly add the correct content in correct place holders
Something like the attached screen-shot is showing
Is this possible in WordPress
Yes! It's possible to implement this! you can use https://codecanyon.net/item/visual-composer-page-builder-for-wordpress/242431 or https://wordpress.org/plugins/siteorigin-panels/ plugin.
The first plugin allows you to create different page layout and save it. It also allows admin to choose page layout that admin has saved previously.
The second page builder plugin allows you to create template same way and allows admin to clone one page layout to another one.
Hope this will help you!

Wordpress: show category-page as frontpage

I want to show a category-page on the frontpage without the url changing (eg. redirect).
The frontpage should implement the categories' head and meta tags then and also the top menu should display the appropriate category selected. also there should be a canonical tag to the categorypage so no duplicate content will be generated.
short: the frontpage should exactly behave like a categorypage.
is there a solution?
You can create your own page template and set is as start page.
Go to:
Apperance->Customize
Then Static front page.
Choose "Static Page"
Then choose your page from the dropdown list.
If you need help look at this.
http://codex.wordpress.org/Creating_a_Static_Front_Page
In addition to Tan's answer, you'll need to go to Settings -> Reading and then select 'A static page' for the 'Front page displays' option. After that you can select your previously created page template from the 'A static page' drop-down menu.
When you finish the above, you'll have to edit the source code for the chosen file in order to include a standard wp loop. For more info, please check this thread:
How do I make a Wordpress Page act like the default home page displaying multiple posts?
To control which posts will be shown in the loop use the query_posts(). You can find more details here:
http://codex.wordpress.org/Function_Reference/query_posts

How to add textbox and buttons in BlogSpot post?

Currently, I can only add static posts to my blog. I can not use it for dynamic purposes like I can do it sites. I want to add text boxes and buttons depending on user input , I want to show dynamic content on my blog.
So it this possible?
I searched on the net but can only find that Blogspot does not allows text boxes and buttons to be added.
Please post some sample code for it.
Thanks,
Ashish
Blogspot posts doesn't allow to insert "input" tag in its posts directly by HTML Editor of posts. To do so you can follow the following steps
Goto the Templete from Admin portal of your blog
click on edit html & add JQuery.js (preferably which is hosted on google /JQueryUI.
in your post add a div in which you will add your input contents.
Now again in your templete html editor, write JQuery to handle event and adding the controls
for demo code you can view this article
Insert input elements in blogspot's post

Is it possible to link to the same page from wordpress page menu?

I have a big one page wordpress site and a menu created from wordpress admin pages panel. I added everywhere in my main page such links like <A NAME="gohere"> and similar. Now I need to add href's to the page menu name's like <a href="#gohere"> Actually I do not know is it possible to do this from the wordpress admin page's menu or maybe anybody know where these pages are stored so that I could add the links manually in the file's. Thanks!
Tried plugin "Page Links to" and added something like <A NAME="gohere"> as a link in where, but unfortunately plugin do not understand this,
Regards,
You shouldn't use the name attribute of the a element. Instead, assign ID values to the elements of your page, for instance:
Link to foo
<div id="foo">
<!-- Your foo content goes here -->
</div>
For your question: You can manually add links to your WordPress menu, entering custom values as the href attribute. To add a link, enter #foo in the URL field of the custom link in the menu admin section.
Are you using the WordPress's built in menu manager? (Appearance -> Menus)
If so, then yes it should be fairly simple.
First you need to mark the areas within the page you want to link to - setting an ID to the element is enough. So if you want the browser to scroll to the top of the latest posts when a link is clicked, for example, you need to add an ID to the tag that contains the latest posts. Then give it a unique name (this is important). So something like id="latest_posts_area" should do it. Be warned though, you may need to edit the template files to do this, so ensure you have taken a backup of your theme just in case you make any mistakes.
So, if you have:
<div class="latest_posts">
You would edit it to be:
<div class="latest_posts" id="latest_posts_area">
Then, in the admin menu, when adding/editing a link, you simply set the URl as #latest_posts_area - then on every page that link is visible, clicking it will scroll the users browser to the to the top of the tag you added the ID to.

Resources