I have the following code for a two-column container: <div class="rh_content rh_content_above_footer rh_page__content"> <div class="wp-container-3 wp-block-columns"> <div class="wp-container-1 wp-block-column"> <h2 style="font-size: 19px;color: #36a8fc;">Trouvez à Altea l’appartement répondant à tous vos critères</h2> <p>Souhaitez-vous une, deux ou trois chambres&nbsp;? Plutôt vue sur l’extraordinaire arrière-pays, ou sur la mer&nbsp;? Votre rêve, c’est plutôt terrasse ou jardin privatif&nbsp;? Et côté architecture&nbsp;? Votre préférence va-t-elle vers le style méditerranéen typique, ou vers une architecture résolument moderne&nbsp;? Comme vous le voyez, de nombreux choix sont possibles.</p> …
I've my login box on any page of my WordPress and I'm trying to redirect to the same page after a user logs in. For example: If I make the login in the URL http://localhost/wordpress/category/sub-category/sold, redirect to the same URL. I've this in my functions.php but, using my $url doesn't work. How can make the redirection? function login_go_home(){ //$url ="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; wp_redirect(home_url()); exit(); }
As the title says, I'm using wp_nav_menu in header.php to load in the audience, secondary, and main menus and when I do, every menu contains every page - or at least many more pages than I selected for the menus. I'm having the hardest time trying to make this work for some reason, so any help is appreciated. Here's the code to register the menus in functions.php: // WordPress Menu Locations function diviecommerce_setup() { register_nav_menus(array( 'primary' => esc_html__( 'Main Menu', …
Not working on WordPress 6.0: https://thealliance.health/for-providers/resources/provider-news-archives/ Working dev site on WordPress 5.9.3: https://ccahdev.wpengine.com/for-providers/resources/provider-news-archives/ Here is the function if somebody can spot what may have been deprecated: function wpb_postsbycategory2022() { $posts = get_posts( array( 'category_name' => 'Provider News', 'nopaging' => true, 'orderby' => 'date', 'order' => 'DESC', // it's DESC; not DSC // There's no use setting posts_per_page when nopaging is enabled. // Because posts_per_page will be ignored when nopaging is enabled. ) ); $_year_year = ''; // previous years value …
I'm using this function to switch to my main website's navigation and display it on all sub sites in my multisite network. Ideally the links should have the following format: http://www.mysite.com/navigation-link but on the sub-sites the urls are http://www.mysite.com/subsite/navigation-link Obviously these pages don't exist so it's just showing a blank page. Any idea how I could make sure the urls are like the first example and how I might incorporate that into my function? function wp_multisite_nav_menu() { global $blog_id; $args …
I wrote a function to only show a limited number of recent posts per page, and it works fine. But I also want to display only one category-name per post (even if the post has several others), I just want it display the first [0] category from each post. I've spend hours on this and I've gotten very close, but just end up with the posts showing all categories on a list, like when using <?php the_category(" "); ?> I …
Sorry - total newbie here with Wordpress development. I have the following plugin installed https://favoriteposts.com/ and it allows you to change the default output of the users favorites by using the following function: /** * Customize the Favorites Listing HTML */ add_filter( 'favorites/list/listing/html', 'custom_favorites_listing_html', 10, 4 ); function custom_favorites_listing_html($html, $markup_template, $post_id, $list_options) { return $html; } I just don't know how to use this. What I would like is for the output to match that of the default woocommerce product …
i want to scrape data from another website that doesn't provide api to my wordpress site, and i want when i input the data url ($baseTarget) it appears directly in the taxonomy input post_tags, title description, category, image etc in new post. i don't know how to make it, i have searched but haven't found any results. scrape.php <?php namespace App\Services; use voku\helper\HtmlDomParser; class MALService { private $baseTarget = 'https://myanimelist.net'; private function init($path) { $curl = curl_init($this->baseTarget . $path); curl_setopt($curl, …
Is there a way to add inline php code to the editor using wp_print_scripts? I'm trying to find a way to display text from a php string into a value of input of a block. Here's my code: function shapeSpace_print_scripts() { ?> <?php $block_yt_url = 'test';?> <script> jQuery(document).ready(function ($) { let $yt_url = false; $(document).on( "click", '#yt_run .acf-button-group', function() { $(".editor-post-publish-button__button").hide(); $(".acf-block-body div div.acf-block-fields.acf-fields div.acf-field.acf-field-text.acf-field-6260f423f1666").css({'height':'inherit','padding':'16px 20px','overflow':'inherit'}); $(".acf-block-body div div.acf-block-fields.acf-fields div.acf-field.acf-field-text.acf-field-6260f423f1666").val(<?php echo $block_yt_url;?>); $('#yt_url .acf-input input').keyup(function(e) { if(e.keyCode == 13) { …
I need to allow user registrations only for those with email addresses on a single domain. I have tested multiple regular expressions and this one works well in a regex sandbox environment, but as soon as I put it into my functions.php file, it simply rejects all registrations - even email addresses on the correct domain (with the error message below, so it's definitely this conditional that's breaking it). Am I: a) actually doing something stupid in the regex, even …
I am trying to get the post id outside the loop in functions.php.but what error i am getting : Notice: Trying to get property of non-object in functions.php on line 549 function theme_myeffecto_disable() { global $wp_query; $post_id = $wp_query->post->ID; $showreaction = get_post_meta( $post_id, 'post_reaction_show', true ); $showreaction = isset($showreaction) ? $showreaction : true; var_dump($showreaction); } add_action( 'init', 'theme_myeffecto_disable', 20 ); and $showrating always comes false weather it is true or false :(
On my site, through a form I send/register same information in database, do a SELECT/query and return it! Return the last table saved in database, just that user just entered on the form (along with some more information coming from the database). How I want to display these values coming from databse in a modal bootstrap it's necessary that the page doesn't give the refresh. For this, I inserted the AJAX as follows: $(document).ready(function(){ $('#enviar').click(function(){ $.ajax({ //CAAL AJAX IN WORDPRESS …
So I've created a panel in the customizer section in WordPress to add the phone number to the site. It works fine in the back end but it wont show up in the front end here is my functions.php function home_smart_register_theme_customizer( $wp_customize ) { $wp_customize->add_panel( 'contact_info', array( 'priority' => 10, 'theme_supports' => '', 'title' => __( 'Contact Info', 'home_smart' ), 'description' => __( 'Set your current address.', 'home_smart' ), ) ); $wp_customize->add_section( 'contact_details_block' , array( 'title' => __('Phone Number','home_smart'), 'panel' …
I have a custom post type called Hotels which I woud like to link to using the below url structure: /{country}/{state}/{hotel-name} I am fetching and inserting posts dynamically, so I do not know the number of countries/states. The Hotel Name is the slug version of the post title. I have been banging my head all day trying to get it to work. The below code works to make the links look correct, but then 404s on all posts: function change_link($permalink, …
EDIT: So I've done some troubleshooting and it seems my theme isn't showing woocommerce search results. The 2017 theme does so I am trying to figure out what my theme is missing. I suspect something in the functions.php file. It's something I'm leaving out, not something I've included that's interfering, because I deleted all my code out of the functions file line by line and nothing changed. I have some custom code I have used elsewhere without any trouble. I …
My site Beta Fox uses Yoast SEO plugin to help deal with SEO common practices, however an issue has arisen. In beginning of last year WordPress didn't fully support webp image types, neither Yoast SEO. Things changed near the end of year, but Yoast SEO unbelievably refuses to support webp (the types Google is forcing upon on us to use). The problem is the fact there's no open graph for image attachments in any page of the site, so that …