New answers tagged

1

I've found a workaround if someone has the same problem: In the database, you can search for the attachment page that's causing problem, you'll find it in wp_posts by searching for its post_name (which is the slug you want). Then just rename that post_name (in about-img for example). It isn't a fix but it will make the desired slug available for your page's ...


0

After many attempts and help from others, I finally got a solution to my problem. That's the code I used: <?php if ( is_front_page() ) { echo "Startseite"; } elseif ( is_singular("project") ) { echo "Projekte"; } elseif ( get_the_title() == "Datenschutz" ) { echo &...


1

If you can setup url query parameters and when user navigates to tagfillterPage page with wp_query it should work. https://examples.com/tagfillterPage/?filltertag=tagname $querytag = $_GET['filltertag']; $args = array( 'tag' => $querytag ); // Custom query. $query = new WP_Query( $args ); // Check that we have query results. if ( $query->...


1

You can use the_title hook to change the title of the post in the admin, something like this add_filter( 'the_title', 'custom_post_title', 10, 2 ); function custom_post_title( $title, $post_id ) { // Return early if not in the admin if ( !is_admin() ) return $title; $post_type = get_post_type( $post_id ); // You only need to ...


0

Resolved using this: <div> <ul> <?php $current_category = get_queried_object(); ////getting current category $args = array( 'post_type' => 'page',// your post type, 'orderby' => 'menu_order', 'order' => 'DESC', 'cat' => $current_category->cat_ID // ...


1

enter your tags instead of the specified ones or delete the extra ones: function wps_display_custom_tags ($post_meta) { // delete meta tags you do not want to display return array( 'author', 'post-date', 'comments', 'sticky', 'tags'); } add_filter('twentytwenty_post_meta_location_single_top', 'wps_display_custom_tags');


0

Can do this with a shortcode. add the following to function.php function lorem_func($attr) { $txt = "<p>Lorem ipsum dolor .........</p>"; shortcode_atts( array( 'repeat' => 1, ), $attr ); return str_repeat($txt, $attr['repeat'] ); } add_shortcode('lorem', 'lorem_func'); To render within content use; [lorem repeat="2"]...


Top 50 recent answers are included