I've got this header menu in my site (made editing a theme), but i've noticed that the custom links pointing at local anchor section (like #section) correctly navigate in the same page to the desired location, but an external link won't work, even if specifing "open in new tab". I suppose something is preventing the menu link to open, or worse, the external link is not supported in that theme. Since i'm noob, where should i look for the menu …
Status quo: the breadcrumbs show the following structure: home/parent-category/sub-category/post And click on parent-category or sub-category links to the default archive pages. This is also the correct hierarchy based on our navigation menu. So in the example above it is home/parent-page/sub-page/post. We want the breadcrumbs link to the actual page and not to the archive page of the category. In the Yoast-Settings > Search Appearance > Breadcrumbs under “Taxonomy to show in breadcrumbs for content types” I can set “Category” for …
I am using Polylang plugin, which assigns each post to a taxonomy 'language'. While using get_adjacent_post() I want to bring only those posts that belong to the language currently displayed. So I am writing the following: $prev_post = get_adjacent_post( true, '', true, 'language' ); $next_post = get_adjacent_post( true, '', false, 'language' ); But this brings the next and previous posts independently from the language they are currently in. Why? I understand in the documentation $in_same_term (first value) specifies whether post …
I am searching for a code or better a wordpress plugin to set automatically all links only to a certain domain (and of course to all of its subpages) to "nofollow". I could not find any plugin which is doing that, maybe you are knowing one or a coding-solution (javascript I guess). F.e. the plugins I found and their problems: https://wordpress.org/plugins/nofollow/ Has only "A nofollow option for individual blogroll links" -> so no possibility to set only a certain domain …
I have a Taxonomy that I would like to change the link to in the WP menu. When clicking it goes to the Add Taxonomy page, like normal. What I would like to do is navigate to the Edit Page. In other words, the taxonomy navigates to edit-tags.php (as expected) /wp-admin/edit-tags.php?taxonomy=news_archive_options&post_type=news What I'd like to do is navigate to the term.php page /wp-admin/term.php?taxonomy=news_archive_options&tag_ID=10&post_type=news Thanks!
I am trying to develop the website to find images that have been deleted from the media library as they were not needed. These Images that I have deleted have previously been on pages but have been replaced on the page now... but if you go to https://tools.pingdom.com/#!/ctzBfY/http://waggypetservices.co.uk you can see that some of the deleted images are still being called... this call also be seen in the page source. My question is how can I find what is calling …
When I print a url onto my site, it automatically gets wrapped in: <blockquote class="wp-embedded-content" data-secret="tDj3qpdVAi"><a href="https://www.example.com/">Example Domain</a></blockquote> even though all I printed to the page is "https://www.example.com/". What is this mechanism and how can I disable either on a specific page or site-wide? What I Tried adding the code here to my functions file: https://crunchify.com/how-to-disable-auto-embed-script-for-wordpress-4-4-wp-embed-min-js/ adding both snippets of code (separately) from here to my functions file: https://kinsta.com/knowledgebase/disable-embeds-wordpress/#:~:text=Disable%20Embeds%20in%20WordPress%20With,the%20core%20contributors%20to%20WordPress.
I'm trying to recieve post ID from link using ACF link field: <?php $link = get_sub_field('offer_link'); $id = get_the_ID(); if( $link ): ?> <a href="#post-<?php echo $id; ?>" target="<?php echo $link['target']; ?>"><?php echo $link['title']; ?></a> <?php endif; ?> but instead of ID of link I get the ID of current page. How should it be done?
After reading this and this, I want to remove the title attribute from all links of my blog, as that is good from accessibility point of view. How this can be achieved? UPDATE I found a solution how to remove title attribute from images, but it doesn't work for me.
Is there a way to add additional first and last page links to the pagination object if it is rendere with the the_posts_pagination() method? At this point I have the following the_posts_pagination( [ 'screen_reader_text' => ' ', 'mid_size' => 2, 'prev_text' => __( 'vorherige', 'bdb' ), 'next_text' => __( 'nächste', 'bdb' ), ]); and I would like to after prev_text a first page link if is not the first page and a last page link before next_text if is not …
I'm trying to make a dynamic button that goes to portfolio page (no matter what ID/name it has), it's currently like this: $portfolio_page = get_option('theme_portfolio_page'); $portfolio_pid = get_page_by_title($portfolio_page); <a href="<?php echo get_option ('theme_portfolio_page') ?>">Voltar</a> The problem is that it links based on the page name, and when it has space on the name it bugs... So I would need a code that links dynamically to the portfolio page by ID When I try to change to get_page_by_id FATAL ERROR: CALL …
I am using a theme where on the blog page only the featured image and the post title are using anchor link. On clicking it redirects to that respective post page. But I want to link the entire so that if anybody clicks on that area it will redirect to that respective post page. I saw a website "https://www.tidio.com/blog/" where their entire article section was linked. So when i inspect their code, I found that they are using pseudo-element ::before …
On this url: https://www.phuket-luxury-villas.us.com/tourist-spots/buddhist-temples-wats/ I have a wrong canonical link: <link rel="canonical" href="https://www.phuket-luxury-villas.us.com/tourist-spots/buddhist-temples-wats/" /> It used to be the follow canonical link: <link rel="canonical" href="https://www.luxuryvillasphuketthailand.com/tourist-spots/buddhist-temples-wats/" /> I tried to use this code: function yoast_seo_canonical_change_woocom_shop( $canonical ) { if ( is_archive() ) { echo ''; } } add_filter( 'wpseo_canonical', 'yoast_seo_canonical_change_woocom_shop', 10, 1 ); But it seems that is put now too many canonical links on the website... Any idea what else I can do? This mentioned url, is an archive (done …
The users of my site mainly share documents by inserting links into content (pages/posts) using the built in editor. These files include everything from pdfs to word documents. The users currently get/copy these links from a php file manager like FileRun. My goal is to have the users instead use a path from mapped network drive such as \testdrive\Folder1\Folder2\test.txt. The following function has been written to handle replacing the mapped network drive files to an internet link such as "http://page.test.org/files/". …
Is there a filter I could use to get and change the html output of a link? I would need to add a target="_blank" in some cases. I'm using the filter post_link to change the url itself where neccessary, but I would need to be able to modify the html part as well. I cannot find correct filter, I ran into a "edit_post_link" filter, but that didn't do the trick as it seems like it's working only at the back-end. …
Wordpress nav menu created by wp_nav_menu can highlight current menu item. How can i strip anchor from current menu item? For example, we have menu: <ul> <li class="current-menu-item"><a href="/somelink">Home</a></li> <li><a href="/elselink">Item</a></li> ... </ul> Can we remove <a href="/somelink"> and leave just "Home" if it is current page? UPD. In my functions.php I have a walker like this: class My_Walker_Nav_Menu extends Walker_Nav_Menu { function start_lvl(&$output, $depth) { $indent = str_repeat("\t", $depth); $output .= "\n$indent<ul class=\"dropdown-menu\">\n"; } } and I've found the …
My goal: I want external links to shops I'm affiliated with (for example amazon) to automatically get the affiliate ID attached to it. Example: link I put in my blog post editor https://www.amazon.com/dp/B07K344J3N/ changes in frontend to https://www.amazon.com/dp/B07K344J3N/?tag=myafftag-02 What I have found: The creator of the theme I'm using is offering something very close to what I'm looking for: add_action('wpfepp_form_actions', 'link_change_custom'); function link_change_custom($data){ if ( !empty( $_POST['rehub_offer_product_url'] ) ) { $url = $_POST['rehub_offer_product_url']; $checkdomain = 'amazon.com'; if (!empty($url) && strpos($url, …
I want to list all the external links of my posts in a single place/file. How can I achieve this? Is it possible to achieve this via a plugin? Is it possible to achieve this with a built-in wordpress api? Is it possible to achieve this via some free 3rd party tool? What approach should be followed for achieving this?
I initially had a wordpress installation on a free hosting service. After the hosting suffered an attack I got a backup of all files and the database and am recovering the site on my localhost (using wampserver 3.1.0 on windows 10) before I can update it and upload it to my new hosting service. The thing is, links are not working and some (not all) images are not displaying, not even on edit mode, and not at all (I mean, …
I want to link content comprised of a custom field(field1_details) using another custom field(field2_link) which is a URL type. the_field('field1_details') is text_area field and get_field('field2_link') is a website field (using a ACF addon). (These custom fields are created using Advanced custom fields plugin) Here is the code I am trying in loop.php: <span class="c_f"><a href="<?php get_field('field2_link'); ?>"><?php if( function_exists('the_field') ) the_field('field1_details'); ?></a></span> Output- <a href="">The text content</a> ( Doesn't out put the link) And tried this without the if <span …