replacing anchor # to full url in wordpress posts - wordpress

I trying to replace the anchor "#downloadbutton" to the full url in all posts.
for example:
#downloadbutton = https://mywebsite.com/kindness-and-gentleness/#downloadbutton
#downloadbutton = https://mywebsite.com/islamic-etiquette/#downloadbutton
#downloadbutton = https://mywebsite.com/hindrances-on-the-path/#downloadbutton.
The reason for this is that when I create excerpts which include anchors from the posts. The anchor urls are not working except if i go back to and change the anchor #download to absolute (full) url. and there many posts. Is there any way to do it through php snippets. Am using wordpress.
Thanks in advance

You can't remove hyperlinks hooks from the url. Hyperlinks hooks are just a way to navigate to a specific content more quickly. For example https://ownwebsite.com/#testimonials will show you the testimonials section straight away on page load.
The only thing you can do is replace the url from the button with your specific url, that way instead of having an hyperlink hook button, you would have a regular plain'ol button that redirect you to a page or else..
You can learn more about the <a> html5 tag behaviour # https://www.w3schools.com/tags/tag_a.asp and you can see a live example of the behaviour # https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_a_href_anchor

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.

wordpress menu link target to _iframe

Instead of having the link opened in a new tab I would like to the link to be opened in an iframe that's on the same page.
Example:
I have my front page with an iframe on it. If I click on the menu items i would like to have the urls loaded in the iframe.
I can't seem to find an answer for this.
Alter the iframe in your front page as below
Make sure the iframe contains a name attribute (name="main-section")
<iframe name="main-section" src="home.html"></iframe>
In your menu items make sure the target attribute redirects to main-section (target="main-section"). This is an important step.
Example:
I am pretty sure you can achieve the above steps in wordpress.

How to add HTML text to every page using Google Optimize?

I would like to add a few lines of HTML to every single product page on my website.
However, it only works on one URL. I'm really sure my URL targetting is setup correctly.
I've selected an element on the page – and used "HTML" and "Insert" to add the code to the page. However it doesn't work on every page.

Drupal 7 front page URL after changing the front page

I have used Configuration|Site Information|Default Front Page to designate node/55 as my front page.
How can I create a menu linking to the original front page, i.e. the one with the list of articles?
If I link to <front> it goes to node/55.
P.S.: I have been able to simulate this by enabling the frontpage view, but, if possible, it would be more efficient to just link to the original front page URL.
As far as I know the original homepage is equal to /node (for clean URLs) or ?q=node. Link to either of these and you should be fine.

Like button on each page

I have a like button on my main page (master page in asp.net).
I added a like button on each dynamic page.
When I try to enter the link:
http://www.friend.co.il/details.aspx?id=2321
to one of the dynamic page in face book developer page:
http://developers.facebook.com/docs/reference/plugins/like/
I get the same number of like as the total site number and not just a number for the specific page.
Any body know whats I'm doing wrong?
Using Facebook's URL Linter on your dynamic page's URL shows that it has Open Graph tags that refer to your website's main page. As a result, Facebook thinks that the canonical URL for http://www.friend.co.il/details.aspx?id=2321 is http://www.friend.co.il/.
You should either remove the meta tags from your subpages, or construct them so that they properly represent the content on each page.
Remove your og:url meta tag and also be sure to not include the Facebook javascript file multiple times like you are currently doing.

Resources