Rewriting URLs – Rewrite the question mark in the post template to get a nice URL

I hope you are all well and you are safe in these times.

I was wondering if anyone can help me remove the question mark (?) In the url.

The URL I want to rewrite looks like this: https://website.com/windows/post-name/?download

The url i want to have: https://website.com/windows/post-name/download

Please tell me what you think

FB Post Template $ 40 7 days or less

Hi Guys!

Hope everyone survives out there!

We need a Facebook post template that we can lay over daily special images.

$ 40USD PayPal Thank you very much!

Requirement:

Meal cards: (Larger text used as logo) Color # de3331
Local community (smaller text near larger text – also changeable level)
SEMrush

Space for a food picture of a family meal, video or text.

Two heading points – use this text below:
Competition!
Find out more!

WordPress shortcode for a section template

I created a section template called section-Countriesinfo.php on the folder home page in the theme folder and pasted this code

                   
'grants ' , 'scholarship_degree'=> 'bachelor', 'status'=>'publish', 'posts_per_page' => -4, 'tax_query' => array( array( 'taxonomy' => 'expired', 'field' => 'slug', 'terms' => array( 'expired' ), 'operator' => 'NOT IN', )),); $q = new WP_Query( $args ); ?>

then I pasted this code into Function.php

         function my_master_shortcode( $attr ) {
         ob_start();
         get_template_part('frontpage/section', 'bachelorscholarships');
         return ob_get_clean();
           }
         add_shortcode( 'mastergrants', 'my_master_shortcode' );

My problem is when I load the homepage to see that the update is still loading without end and gets stuck. Any help

8 – Should a block render array created with EntityViewBuilderInterface :: view render the complete block template or only inner fields?

After rendering custom blocks in templates, the following error appeared: Quick Edit was unable to match the rendered entity field markup. What I've done so far:

In order to render custom blocks repeatedly in templates, I wrote this function in mytheme.theme ::

function render_block_in_template($block_id) {
  // $block = Drupal::entityTypeManager()->getStorage('block_content')->load($block_id);
  $block = Drupalblock_contentEntityBlockContent::load($block_id);

  if(!empty($block)) {
    $block_content = Drupal::entityTypeManager()
      ->getViewBuilder('block_content')
      ->view($block);

    if($block_content) {
      // kint($block_content);
      return $block_content;
    }
  }
}

And I call it mytheme_preprocess_node ::

function mytheme_preprocess_node(&$variables) {
  $node = $variables('node');

  if($node->bundle() == 'some_bundle') {
    $variables('some_block') = render_block_in_template(12);
    $variables('some_other_block') = render_block_in_template(13);
    // ...
  }
}

Then I render the blocks in node--some-bundle.html.twig ::

{{ some_block }}
{{ some_other_block }}

So far, so good. But I got this js error from quickedit.js:

Error: Quick Edit could not match the markup of the rendered entity field
(With (data-quickedit-field-id="block_content/12/body/fr/full")) With
the corresponding rendered entity markup: no parent DOM node found
With (data-quickedit-entity-id="block_content/12"). It is typical
caused by submitting the theme for this entity type
Print the attributes.

This brought me to this problem: custom blocks abort the layout builder module – Quick Edit was unable to match the markup for rendered entity fields, but applying the patch didn't change anything, and upon further reading, I found that this wasn't accurate related.

If I {{ kint(some_block) }} In branch, the key is #attributes with the expected values ​​here:

Enter the image description here

and this is the HTML output:

// FIELD CONTENT

Finally, the error is corrected by manual wrapping with the following error:

So it seems that the above Wrapper part the block template is not rendered, only the fields are there and it causes the error.

Is there really a mistake or am I doing something wrong?

Add a custom admin menu item for pages using a specific template

I want to add a new custom menu item to the WordPress admin sidebar that displays pages that use a specific template. For example, a group of pages that uses the Retailer Sendout template (page-Retailer-sendout.php) is displayed under the top-level Standard Pages menu item.

I've tried the following URL combinations, but none of them have worked so far.

I've also tested some plugins to customize the admin menu, but they don't offer a way to create links to pages with a specific template name.

I'm happy with adding a custom function to the theme's functions.php file, but I don't know where to start.

Any help is greatly appreciated.

Subject – Print a taxonomy term and URL D8 view template

I am completely new to Drupal 8. I have used d7 and am now migrating.

I have set up a view with 4 articles.

I managed to print in a custom view theme

  1. my title
  2. Image URL
 {% for row in content('#view').result %}


   {% set image_uri = row._entity.field_image.entity.uri.value %}


   {{ image_uri|image_style('blog_298x200') }}

   {{ content('#view').field('title').value(row) }} 



 {% endfor %}

My template file is: block – views-block – main article-block-miniatures-slider.html.twig

I would be very grateful for any tip to get what I need:

  1. The node URL
  2. The taxonomy (field_categorie) and its URL
  3. Creation Date

I installed the Tweak Twig module to make it easier for me

Custom template page with custom archives listed by the user

I have an archive page for my post type. It works, I'm using the template part with the parameters get_post_type ().

This is my content-activite.php file



    
<a href = ""> <img class = "card-img-top" src = "http://wordpress.stackexchange.com/"" alt = "http://wordpress.stackexchange.com/">

I have to create the same layout with the same archive, but for my current user.

So I created my page, assigned a template to it, and created my custom query.

But if I use that ($ post_type = get_post_type ()):

            have_posts()) : ?>
                have_posts()) : $the_query->the_post();
                    the_post();
                    get_template_part('template-parts/content', $post_type);
                endwhile;
            endif; ?>

the title(); gets the name of the page and not the name of my post. How can I get the name of my contribution?

PS: I have to change some data that is shown in the template part, but only use one file for the activities of my user and my archives.

Change default template in the block editor (Gutenberg)

I want to change the default template for my pages to a template named fullwidthpage.php.

I have seen this question posted and answered for Gutenberg WordPress, but I have not found a working answer for Gutenberg WordPress (version 5.3.2 at the time of this question).

This is the non-working answer that I found. If I try the non-working answer, the template is set to fullwidthpage.php However, when I try to refresh the page, I get an "Update Failed" message.