Render a loop in Timber (twig for WordPress)

@Xroad, here’s the simplest way. Things can get a bit more complicated depending on the specifics, but this is the most straightforward way: $query = get_posts(array(‘post_type’ => ‘lexique’,’posts_per_page’ => -1)); $by_letter = array(); while( $query->have_posts() ) { $query->the_post(); global $post; $letter = substr($post->post_name, 0, 1); if ( ! isset($by_letter[$letter]) ) $by_letter[$letter] = array(); $by_letter[$letter][] = … Read more

Recover Same WordPress Admin Password

In general, no. This is not possible. The password is btw, not encrypted only once, but twice with md5. There are some cases where you type the password to the database, and for the short time, it will not be encrypted at all. 🙂 The very first time the admin authenticate itself again, the password … Read more

cannot log in to the mysql server (wamp and wordpress)

The default Wamp user`s credentials are: username: root password: (empty, nothing, nada) If you already have a WordPress website previously created on your Wamp system, then go to /www/yourlocalsite/wp-config.php and check out the username and password you set. Here`s an example: /** MySQL database username */ define(‘DB_USER’, ‘root’); /** MySQL database password */ define(‘DB_PASSWORD’, ”); … Read more

How do I display 3 post each in a bootstrap carousel?

A div with class=”item” is used for each carousel slide. But right now your foreach loop is inside that div, not outside, so all of your posts are going into one slide. So just change that bit to: <div class=”carousel-inner”> <?php foreach ($lastposts as $post) : setup_postdata ($post); ++$index; ?> <div class=”item<?php if ($index == … Read more

Import and use a variable in additional settings of Contact Form 7 [closed]

if only the domain changes, you could try using relative urls: document.location=”/thank-you”; But if the domain you’re redirecting to is different than the page you’re on, a simple way to fix this problem would be to add a customizer value redirect_domain, and then make it a global variable in footer.php <script>var RedirectUrl=<?php echo get_theme_mod(redirect_domain);?></script> then … Read more

Why does my WordPress index has a category?

Well I havent found why there’s a category to my homepage but I found the function is_home() and added it to my if: if($category[0]->{‘name’} !== “Blog” || is_home()){ echo “document.onload = removeWhiteDiv();”; } if($category[0]->{‘name’} === “Blog” && !is_home()){ echo “headerAnimation();”; }