/* Transitions */
@view-transition {
navigation: auto;
}
/* Kadence css “fixings” */
body {
text-wrap: pretty;
}
/* header mobile */
.drawer-content .site-header-item {
overflow-y: auto;
max-width: 90vh;
}
.mobile-navigation {
max-height: 100%;
}
.kt-btn-width-type-auto {
width: auto;
}
.kb-adv-form-message.kb-adv-form-warning {
padding: 0.1em 1em;
}
.new-row-diferent-height .kt-inner-column-height-full:not(.kt-row-layout-row) {
grid-auto-rows: unset;
}
@media (max-width: 1024px) {
#block-8 figure {
margin: 0 auto;
}
.kt-inner-column-height-full.kt-tab-layout-equal, .kt-inner-column-height-full:not(.kt-tab-layout-inherit):not(.kt-tab-layout-row) {
grid-auto-rows: unset;
}
}Kadence, canviar el titols de archive i tax
El més importat és el tema de afegir prioritat al filtre, amb 100 es suficient, de moment.
/**
* Canviar títols d'arxiu a Kadence
* IMPORTANT: Prioritat alta (100) necessària perquè Kadence processa després
*/
function change_archive_titles( $title ) {
if ( is_post_type_archive( 'exposicio' ) ) {
return __( 'Les exposicions', 'kadence' );
}
if ( is_tax() && get_queried_object_id() == 4 ) {
$term_name = get_term( 4, 'estat' )->name;
return sprintf(__('Les exposicions %s','kadence'), $term_name);
}
return $title;
}
add_filter( 'get_the_archive_title', 'change_archive_titles', 100 );Traducció de les url del arxius dels CPT
Fem servir ACF per crear els CPT.
Es important no tocar aquest opció, encara que sigui la més evident (deixar la opció en blanc):

Sinó que hem de tocar-ho aquí:

Així després podem fer la traducció al WPML:

MAMP i bases de dades amb Laravel
Es important posar això al arxiu .env quan estem treballant en mac (no comprovat Windows):
DB_SOCKET=/Applications/MAMP/tmp/mysql/mysql.sockSinó dona error al fer migracions, etc… desde la terminal.
Traduïr titols de Archive a kadence
// WPML translate CPT 'immoble' archive title on es
function wpml_translate_cpt_archive_title($title)
{
if (apply_filters( 'wpml_current_language', null ) == 'es' && is_post_type_archive('immoble')) {
$title = __('Inmuebles', 'kadence-child');
}
return $title;
}
add_filter('get_the_archive_title', 'wpml_translate_cpt_archive_title', 100);CSS per al Switcher de WPML
Integració a la capçalera de kadence theme
/* wpml */
.header-html .wpml-ls-legacy-list-horizontal.wpml-ls-statics-footer {
margin-bottom: 0;
}
.wpml-ls-item {
position: relative;
}
.wpml-ls-item .wpml-ls-link {
padding-left: calc(2em / 2);
padding-right: calc(2em / 2);
padding-top: 0.6em;
padding-bottom: 0.6em;
}
.wpml-ls-item.wpml-ls-current-language:after {
content: '';
width: 100%;
position: absolute;
bottom: 0px;
height: 2px;
right: 50%;
background: var(--global-palette1);
-webkit-transform: scale(0, 0) translate(-50%, 0);
transform: scale(0, 0) translate(-50%, 0);
transition: color .0s ease-in-out, -webkit-transform .2s ease-in-out;
transition: transform .2s ease-in-out, color .0s ease-in-out;
transition: transform .2s ease-in-out, color .0s ease-in-out, -webkit-transform .2s ease-in-out;
width: calc(100% - 2em);
transform: scale(1, 1) translate(50%, 0);
}
.transparent-header .wpml-ls-item.wpml-ls-current-language:after {
background: var(--global-palette9);
}
.wpml-ls-item.wpml-ls-current-language .wpml-ls-link {
color: var(--global-palette1);
}
/* Si posem el shortcode dins del menú mobile, sinó esborrar o no actua */
#mobile-drawer .wpml-ls-item.wpml-ls-current-language:after,
#mobile-drawer .mobile-html .wpml-ls-item.wpml-ls-current-language .wpml-ls-link {
color: var(--global-palette9);
}Copy/Paste del “Block Content”, que ha desaperegut en Kadence🤷🏻♂️
De moment, pots fer servir el block Dynamic HTML block:

One page links per Kadence
function highlightAnchorLinks() {
// Get the menu elements
const primaryMenu = document.getElementById('primary-menu');
const mobileMenu = document.getElementById('mobile-menu');
// Get all anchor links within the primary menu
const primaryAnchorLinks = primaryMenu.querySelectorAll('li > a[href*="#"]');
// Get all anchor links within the mobile menu
const mobileAnchorLinks = mobileMenu.querySelectorAll('li > a[href*="#"]');
// Function to extract the target ID from the href attribute
const extractTargetId = (href) => {
const hashIndex = href.indexOf('#');
return hashIndex !== -1 ? href.substring(hashIndex + 1) : null;
};
// Create an intersection observer instance for the primary menu
const primaryObserver = new IntersectionObserver(entries => {
entries.forEach(entry => {
const targetId = entry.target.getAttribute('id');
const listItem = primaryMenu.querySelector(`li > a[href$="#${targetId}"]`).parentNode;
if (entry.isIntersecting && entry.intersectionRatio >= 0.5) {
const activeListItem = primaryMenu.querySelector('.current-menu-item');
if (activeListItem) {
activeListItem.classList.remove('current-menu-item', 'current_page_item');
}
listItem.classList.add('current-menu-item', 'current_page_item');
} else {
listItem.classList.remove('current-menu-item', 'current_page_item');
}
});
}, { threshold: [0.5] });
// Create an intersection observer instance for the mobile menu
const mobileObserver = new IntersectionObserver(entries => {
entries.forEach(entry => {
const targetId = entry.target.getAttribute('id');
const listItem = mobileMenu.querySelector(`li > a[href$="#${targetId}"]`).parentNode;
if (entry.isIntersecting && entry.intersectionRatio >= 0.5) {
const activeListItem = mobileMenu.querySelector('.current-menu-item');
if (activeListItem) {
activeListItem.classList.remove('current-menu-item', 'current_page_item');
}
listItem.classList.add('current-menu-item', 'current_page_item');
} else {
listItem.classList.remove('current-menu-item', 'current_page_item');
}
});
}, { threshold: [0.5] });
// Observe each section for the primary menu
primaryAnchorLinks.forEach(anchorLink => {
const targetId = extractTargetId(anchorLink.getAttribute('href'));
const section = document.getElementById(targetId);
if (section) {
primaryObserver.observe(section);
}
});
// Observe each section for the mobile menu
mobileAnchorLinks.forEach(anchorLink => {
const targetId = extractTargetId(anchorLink.getAttribute('href'));
const section = document.getElementById(targetId);
if (section) {
mobileObserver.observe(section);
}
});
}
// Call the function when the DOM is fully loaded
document.addEventListener('DOMContentLoaded', highlightAnchorLinks);
Hooks portfolio block Kadence
/**
* Server rendering for Post Block Inner Loop
*
* @param array $attributes the block attributes.
*/
function kadence_blocks_pro_render_portfolio_block_loop( $attributes ) {
$image_align = ( isset( $attributes['alignImage'] ) && isset( $attributes['displayImage'] ) && true === $attributes['displayImage'] && has_post_thumbnail() ? $attributes['alignImage'] : 'none' );
echo '<div class="kb-blocks-portfolio-grid-item">';
do_action( 'kadence_blocks_portfolio_loop_start', $attributes );
echo '<div class="kb-blocks-portfolio-grid-item-inner-wrap kb-feat-image-align-' . esc_attr( $image_align ) . '">';
/**
* Kadence Blocks Portfolio Loop Start
*
* @hooked kb_blocks_pro_get_portfolio_image - 20
*/
do_action( 'kadence_blocks_portfolio_loop_image', $attributes );
echo '<div class="kb-portfolio-grid-item-inner">';
/**
* Kadence Blocks Portfolio before Hover content.
*
* @hooked kb_blocks_pro_portfolio_hover_link - 10
* @hooked kb_blocks_pro_portfolio_hover_divs - 20
*/
do_action( 'kadence_blocks_portfolio_loop_before_content', $attributes );
echo '<div class="kb-portfolio-content-item-inner">';
/**
* Kadence Blocks Portfolio Hover content.
*
* @hooked kb_blocks_pro_get_portfolio_lightbox - 20
* @hooked kb_blocks_pro_get_portfolio_title - 20
* @hooked kb_blocks_pro_get_portfolio_taxonomies - 30
* @hooked kb_blocks_pro_get_portfolio_excerpt - 40
*/
do_action( 'kadence_blocks_portfolio_loop_content_inner', $attributes );
echo '</div>';
echo '</div>';
echo '</div>';
do_action( 'kadence_blocks_portfolio_loop_end', $attributes );
echo '</div>';
}Ruta: /wp-content/plugins/kadence-blocks-pro/dist/dynamicblocks/portfolio-grid-carousel.php
Database Cleaner & Optimizer
Descripció
El millor netejador de bases de dades des del 2022! Netegeu la vostra base de dades de veritat, sigui quina sigui la seva mida. També se centra en allò que importa, per tal que el vostre WordPress sigui més ràpid. Una interfície d’usuari amigable i moderna us ajudarà a fer-ho tot perfecte. Si hi ha massa dades per eliminar, Database Cleaner utilitzarà sol·licituds asíncrones per processar-les a poc a poc per evitar errors i temps d’espera.
Enllaç: https://wordpress.org/plugins/database-cleaner/
Per provar encara…
