Vielen Dank. Werde ich einbauen. :)
Beiträge von Mr.Quick
-
-
-
Danke.
Wenn ich das richtig verstanden habe, müsste der u. s. Code funktioneren, ohne das ich in der functions.php noch etwas ändern muss.?
Danke voraus.
-
Vielen Dank.
Die Funktion ist interessant | https://developer.wordpress.org/reference/func…tachment_image/
Was ich aber bräuchte wäre der Code wie ich das Beitragsbild dann in den MetaTag bekomme.
Danke voraus.
-
Hab mir einfach mal die Lösung Custom-Field genommen.
Funktioniert auch. (s.u.). Das reicht mir auch so, da es bei mir nur daraum geht die Seiten zu posten. Davon hab ich max. 15.Frage wäre jetzt noch. Muss ich in meinem Twitter-Account TwitterCards jetzt noch extra freischalten?
Danke voraus.
-
Ich habe mir jetzt die Meta-Tags statisch eingefügt. Funktioniert erstmal. Ich schau mal ob ich was gebastelt bekomme um das Beitragbild als Large-Image dynamisch zu bekommen. Dann bin ich zufrieden mit der Lösung
-
Ja, das funktioniert diesmal weil ich das PlugIn JM Twitter Cards installiert habe.
Ich würde mir aber in die produktive Webseite ungerne das als PlugIn installieren.
-
Hallo, das U-Boot ist cool...
Ich hab jetzt den Code in einer Testinstallation eingebaut | https://twittercards.4lima.de
Es kommt zwar dort kein Error, aber der Validator https://cards-dev.twitter.com/validator gibt kein positives Ergebnis aus.
INFO: Page fetched successfully
INFO: 5 metatags were found
ERROR: No card found (Card error)Danke voraus.
-
Hallo,
ich versuche Twitter Cards einzubauen.
Der u.s. Code führt leider zu einem Error in Wordpress.
https://www.wpbeginner.com/wp-tutorials/h…s-in-wordpress/
Für Hilfe, Danke voraus.
PHP
Alles anzeigen<?php #twitter cards hack if(is_single() || is_page()) { $twitter_url = get_permalink(); $twitter_title = get_the_title(); $twitter_desc = get_the_excerpt(); $twitter_thumbs = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), full ); $twitter_thumb = $twitter_thumbs[0]; if(!$twitter_thumb) { $twitter_thumb = 'http://www.gravatar.com/avatar/8eb9ee80d39f13cbbad56da88ef3a6ee?rating=PG&size=75'; } $twitter_name = str_replace('@', '', get_the_author_meta('twitter')); ?> <meta name="twitter:card" value="summary" /> <meta name="twitter:url" value="<?php echo $twitter_url; ?>" /> <meta name="twitter:title" value="<?php echo $twitter_title; ?>" /> <meta name="twitter:description" value="<?php echo $twitter_desc; ?>" /> <meta name="twitter:image" value="<?php echo $twitter_thumb; ?>" /> <meta name="twitter:site" value="@libdemvoice" /> <? if($twitter_name) { ?> <meta name="twitter:creator" value="@<?php echo $twitter_name; ?>" /> <? } } ?> -
-
Gut möglich, um aber das ganze Problem zu beleuchten - "Das kopieren von urheberrechtlich geschützen Inhalten" - dies würde den Rahmen hier überschreiten.
-
Auch dafür vielen Dank. Immerhin ist es eine kleine Hürde.
-
Danke. Mit CSS ist das ja sehr einfach.
-
Hallo,
ich habe jetzt mehrere Webseiten gesehen wo der Text nicht kopierbar ist. Lässt sich das in Wordpress auch realisieren?
Danke voraus.
-
Hallo, vielen Dank.
Das ist der Code aus dem Parent-Theme. Aktuelles Theme: Twentyfifteen 3.0.
Danke voraus.
PHP
Alles anzeigen<?php /** * The template for displaying the header * * Displays all of the head element and everything up until the "site-content" div. * * @package WordPress * @subpackage Twenty_Fifteen * @since Twenty Fifteen 1.0 */ ?><!DOCTYPE html> <html <?php language_attributes(); ?> class="no-js"> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width"> <link rel="profile" href="https://gmpg.org/xfn/11"> <link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>"> <!--[if lt IE 9]> <script src="<?php echo esc_url( get_template_directory_uri() ); ?>/js/html5.js?ver=3.7.0"></script> <![endif]--> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <?php wp_body_open(); ?> <div id="page" class="hfeed site"> <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentyfifteen' ); ?></a> <div id="sidebar" class="sidebar"> <header id="masthead" class="site-header" role="banner"> <div class="site-branding"> <?php twentyfifteen_the_custom_logo(); if ( is_front_page() && is_home() ) : ?> <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> <?php else : ?> <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> <?php endif; $description = get_bloginfo( 'description', 'display' ); if ( $description || is_customize_preview() ) : ?> <p class="site-description"><?php echo $description; ?></p> <?php endif; ?> <button class="secondary-toggle"><?php _e( 'Menu and widgets', 'twentyfifteen' ); ?></button> </div><!-- .site-branding --> </header><!-- .site-header --> <?php get_sidebar(); ?> </div><!-- .sidebar --> <div id="content" class="site-content"> -
-
Problem liegt wohl hier...
default-constants.php
Code
Alles anzeigenfunction wp_templating_constants() { /** * Filesystem path to the current active template directory. * * @since 1.5.0 */ define( 'TEMPLATEPATH', get_template_directory() ); /** * Filesystem path to the current active template stylesheet directory. * * @since 2.1.0 */ define( 'STYLESHEETPATH', get_stylesheet_directory() );funtions.php für das Child Theme
-
Leider hat es sich nicht erfüllt. Ich hab die Orginal header.php aus dem Theme am laufen.
Fehlermeldung im Log weiterhin.Für Hilfe wieder Danke voraus.
-
Danke.
Das schaue ich mir an. Hört sich ja nur nach einem kleinen Problem an. :) -
Hallo,
seit der Umstellung auf PHP 8.0 habe ich Fehlermeldungen im Log.
Schein was mit dem Child-Theme zu tun haben.
Für Hilfe, Danke voraus.
CodeAH01071: Got error 'PHP message: PHP Warning: Constant TEMPLATEPATH already defined in /var/www/vhosts/example.com/httpdocs/wp-includes/default-constants.php on line 393PHP message: PHP Warning: Constant STYLESHEETPATH already defined in /var/www/vhosts/example.com/httpdocs/wp-includes/default-constants.php on line 400PHP message: PHP Warning: Undefined array key 0 in /var/www/vhosts/example.com/httpdocs/wp-content/themes/twentyfifteen-child/header.php on line 17PHP message: PHP Warning: Attempt to read property "ID" on null in /var/www/vhosts/example.com/httpdocs/wp-content/themes/twentyfifteen-child/header.php on line 17PHP message: PHP Warning: Attempt to read property "ID" on null in /var/www/vhosts/example.com/httpdocs/wp-content/themes/twentyfifteen-child/header.php on line 88PHP message: PHP Warning: Trying to access array offset on value of type bool in /var/www/vhosts/example.com/httpdocs/wp-content/themes/twentyfifteen-child/header.php on line 88PHP message: PHP Warning: Undefined array key 0 in /var/www/vhosts/example.com/httpdocs/wp-content/themes/twentyfifteen-child/header.php on line 91PHP message: PHP Warning: Attempt to read property "ID" on null in /var/www/vhosts/example.com/httpdocs/wp-content/themes/twentyfifteen-child/header.php on line 91'CodeAH01071: Got error 'PHP message: PHP Warning: Constant TEMPLATEPATH already defined in /var/www/vhosts/example.com/httpdocs/wp-includes/default-constants.php on line 393PHP message: PHP Warning: Constant STYLESHEETPATH already defined in /var/www/vhosts/example.com/httpdocs/wp-includes/default-constants.php on line 400PHP message: PHP Warning: Trying to access array offset on value of type bool in /var/www/vhosts/example.com/httpdocs/wp-content/themes/twentyfifteen-child/header.php on line 88'CodeAH01071: Got error 'PHP message: PHP Warning: Constant TEMPLATEPATH already defined in /var/www/vhosts/example.com/httpdocs/wp-includes/default-constants.php on line 393PHP message: PHP Warning: Constant STYLESHEETPATH already defined in /var/www/vhosts/example.com/httpdocs/wp-includes/default-constants.php on line 400'