Skip to content

Instantly share code, notes, and snippets.

@MrThiemann
MrThiemann / test_angebote.php
Last active August 13, 2020 04:15
test_angebote.php
<?php
<div class="one_field">
<div class="active-goods-item ">
<div class="tab_content active ">
<ul class="produ-list clearfix js-brandsItem moregoods_color ">
<li class="googleTempTwo subjectGoodItem">
<div class="pro-content">
<div class="goods-img pr">
@MrThiemann
MrThiemann / vergleich-tabelle.php
Created August 14, 2020 13:06
vergleich-tabelle
<?php
$args = array(
'post_type' => '3d_drucker',
'posts_per_page' => '10',
//'orderby' => 'Platzierung',
'order' => 'ASC',
'orderby' => 'meta_value_num',
'meta_key' => 'platzierung',
'meta_value' => '10',
'meta_compare' => '>'
@MrThiemann
MrThiemann / README.md
Last active August 18, 2020 04:54
css Tooltipp : hover
@MrThiemann
MrThiemann / include_image.php
Last active August 16, 2020 09:00
include image if...elseif...else Statement
<div class="druckerimage">
<?php $image = get_field('image');
$src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full', false, '' );
if( has_post_thumbnail() ) {
echo '<figure class="gesamt">';
the_post_thumbnail('medium');
echo '<figcaption>'.the_field( 'image_description' ).'</figcaption>';
echo '</figure>';
}
@MrThiemann
MrThiemann / vendor-settings.php
Created August 16, 2020 18:42
Vendor Settings
<?php
/*
* Step 1. Add Link (Tab) to My Account menu
*/
add_filter ( 'woocommerce_account_menu_items', 'misha_vendor_details_link', 40 );
function misha_vendor_details_link( $menu_links ){
$menu_links = array_slice( $menu_links, 0, 5, true )
+ array( 'vendor-settings' => 'Verkäufer Einstellungen' )
@MrThiemann
MrThiemann / printer-information.php
Created August 18, 2020 06:45
Printer Information
<?php if ( have_rows( 'printer_information' ) ) : ?>
<?php while ( have_rows( 'printer_information' ) ) : the_row(); ?>
<?php $vendor_3d_drucker_hersteller = get_sub_field( 'vendor_3d_drucker_hersteller' ); ?>
<?php if ( $vendor_3d_drucker_hersteller ) : ?>
<?php $get_terms_args = array(
'taxonomy' => 'hersteller',
'hide_empty' => 0,
'include' => $vendor_3d_drucker_hersteller,
); ?>
<?php $terms = get_terms( $get_terms_args ); ?>
@MrThiemann
MrThiemann / vendor_printer_settings.php
Created August 19, 2020 05:36
vendor_printer_settings
<?php if ( have_rows( 'printer_information' ) ) : ?>
<?php while ( have_rows( 'printer_information' ) ) : the_row(); ?>
<?php $vendor_3d_drucker_hersteller = get_sub_field( 'vendor_3d_drucker_hersteller' ); ?>
<?php if ( $vendor_3d_drucker_hersteller ) : ?>
<?php $get_terms_args = array(
'taxonomy' => 'hersteller',
'hide_empty' => 0,
'include' => $vendor_3d_drucker_hersteller,
); ?>
<?php $terms = get_terms( $get_terms_args ); ?>
@MrThiemann
MrThiemann / functions.php
Created August 19, 2020 09:51
custom tab in vendor store page
<?php
add_action( 'wcfmmp_rewrite_rules_loaded', function( $wcfm_store_url ) {
add_rewrite_rule( $wcfm_store_url.'/([^/]+)/printer_information?$', 'index.php?'.$wcfm_store_url.'=$matches[1]&printer_information=true', 'top' );
add_rewrite_rule( $wcfm_store_url.'/([^/]+)/printer_information/page/?([0-9]{1,})/?$', 'index.php?'.$wcfm_store_url.'=$matches[1]&paged=$matches[2]&printer_information=true', 'top' );
}, 50 );
add_filter( 'query_vars', function( $vars ) {
$vars[] = 'printer_information';
return $vars;
}, 50 );
<div class="druckerimage">
<?php $image = get_field('image');
$src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full', false, '' );
if( has_post_thumbnail() ) {
echo '<figure class="gesamt">';
the_post_thumbnail('medium');
echo '<figcaption>'.the_field( 'image_description' ).'</figcaption>';
echo '</figure>';
}
@MrThiemann
MrThiemann / README.md
Last active August 24, 2020 05:01
woo-translation