MMK
  • Member for 3 years, 5 months
  • Last seen more than a week ago
  • Dusseldorf
Syntax Issue: How Do I Call A Custom Field Inside a ForEach Statement?
Accepted answer
2 votes

<ul> <?php $recent_posts = wp_get_recent_posts(array('post_type'=>'news')); foreach( $recent_posts as $recent ) { echo '<li><a href="' . get_permalink($...

View answer
Shop page custom buttons which is visible to only administrator
Accepted answer
1 votes

you can use the following code to check if a user is logged in and has a valid role. add_action( 'woocommerce_after_shop_loop_item', 'product_visibility_button', 5 ); function ...

View answer
add custom css on all page exept of one
1 votes

add this to end of functions.php function mmk_enqueue_script(){ if( !is_page(123) ){ wp_enqueue_style('responsive-css', get_stylesheet_directory_uri() . '/custom.css', false); } } ...

View answer
Why Wordpress suddenly changed sizes of thumbnails?
Accepted answer
1 votes

for performance reasons, WordPress creates copies of image files in various sizes. There are three default sizes, while rest of them are usually defined by themes or plugins. If you don't want to use ...

View answer
Getting an error. Need to add favicon in my child theme functions.php. What's wrong?
Accepted answer
1 votes

add_action('wp_head', 'my_favicon'); function my_favicon() { echo "<link rel='shortcut icon' href='" . get_stylesheet_directory_uri() . "/images/favicon.ico'>"; }...

View answer
WooCommerce product title formatting
Accepted answer
1 votes

Add Brand as taxonomy: if ( ! function_exists( 'brand_tax' ) ) { // Register Custom Taxonomy function brand_tax() { $labels = array( 'name' => _x( 'Brands', '...

View answer
How to add custom HTML tags in the visual mode via keyboard only?
0 votes

if you are using classic TinyMCE editor then perhaps you can modify it add custom styles. Following code may help you create visual buttons for adding inline styles. // Add Formats Dropdown Menu To ...

View answer
optimal taxonomy or custom post types
0 votes

You can create custom taxonomies and attach them with woo-commerce products. (https://developer.wordpress.org/reference/functions/register_taxonomy/) you can use the following plugin to create custom ...

View answer
Redirect Pending Review Status Preview page url to custom url
Accepted answer
0 votes

function mmk_pending_review_redirect(){ $user = wp_get_current_user(); if(get_post_status ( get_the_id() ) != 'publish') if (is_user_logged_in() && !in_array( '...

View answer
Get parent category field from child category
0 votes

$terms = get_the_terms( get_the_ID(), 'category' ); if ( $terms ) { foreach ( $terms as $term ) { $cat_id = $term->term_id; $cat_color = get_field('category-color', 'category' . '_' . $...

View answer
Newbie problem with adding include wp_footer
0 votes

<?php wp_footer(); ?> remove include and add a semicolon at the end.

View answer
Hide custom post type by user roles
0 votes

if you want to use the plugin. Advance Access manager. https://wordpress.org/plugins/advanced-access-manager/ The plugin basically allows you to not only manage access to the backend and front for ...

View answer
ACF + contact form 7
0 votes

In addition, the field can be populated with the help of post meta [email* destination-email id:exp-email default:default:post_meta ] destination-email = ACF field id. instead of email, a hidden ...

View answer
wp_insert_post if page doesn't exist under current page
Accepted answer
0 votes

$args = array( 'post_type' => 'page', 'posts_per_page' => -1, 'post_parent' => $post->ID, ); $children= new WP_Query( $args ); $seasonepisode = ...

View answer
Adding Custom Metadata to my Archive/Posts page
0 votes

try this (assuming your custom acf field is of type text), $source = get_field('source', get_the_id());

View answer
How to insert custom text after H1 to all my blog posts?
0 votes

add_filter('wp_title', 'filter_pagetitle'); function filter_pagetitle($title) { if ( is_single() && 'post' == get_post_type() ) { return $title ."<br>THIS ARTICLE MAY CONTAIN ...

View answer
WordPress Admin bar missing from custom theme
Accepted answer
0 votes

add_filter( 'show_admin_bar', '__return_true'); Add this at the end of functions.php

View answer
Display data from phpMyAdmin with WordPress
0 votes

If it is third party DB you can first connect and then fetch results mydb = new wpdb('username','password','database','localhost'); $rows = $mydb->get_results("select Name from my_table");...

View answer
Cant get blog name with get_option
Accepted answer
0 votes

You need access to the property of $username to get the name $user = wp_get_current_user(); $username= $user->display_name; Get option method will return the name of the site you have set in ...

View answer
How to display Common posts from specific Tag & Category with Shortcode
Accepted answer
0 votes

function common_cats($att){ $args = array( 'category__and' => $att['category'], //must use category id 'tag__in' => $att['tag'], //must use tag id for this field '...

View answer
get current user password on the profile edit page
0 votes

I think you cannot get a user password by default as it is stored in a hashed format. However, you can check the user input against stored passwords with the help of the following function. ...

View answer
Get parent category name when only child category is applied to a product
0 votes

Check if it works for you... i have modified the loop /Woo Cat product $woo_single_cats = get_the_terms( $post->ID, 'product_cat' ); if ( $woo_single_cats && ! is_wp_error( $...

View answer
Translate string inside twig template
0 votes

I managed to assign a variable to context. $context = Timber::get_context(); $context['search_placeholder'] = __("Suche","pixel_framework"); Timber::fetch('test.twig',$context); inside twig <...

View answer
HTTP status 404 (error) when trying to log in
0 votes

define( 'WP_HOME', 'http://example.com' ); define( 'WP_SITEURL', 'http://example.com' ); Add this to your wp-config.php which you can find in the root of your website. Remember to change example.com ...

View answer
Limit search to posts and pages
-1 votes

and add this to functions.php if you want to search only in posts and pages. function mk_searchfilter($query) { if ($query->is_search && !is_admin() ) { $query->set('...

View answer