Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #335055

    Hello,

    I need to know where in the php-code I can adapt the output of the Twitter-Sharing-Link at the bottom of the blog-post. I want to include predefined hashtags. The Twitter api allows this by including “&hashtags=value”.

    Thanks

    #335404

    Hey shenom!

    Thank you for using Enfold.

    You can edit includes > helper-social-media.php. Find this code:

    'twitter' 	=> array("encode"=>true, "encode_urls"=>false, "pattern" => "https://twitter.com/share?text=[title]&url=[shortlink]")
    

    Cheers!
    Ismael

    #338707

    Hello Ismael,

    this is exactly what I did.

    I changed includes > helper-social-media.php to this:
    https://twitter.com/intent/tweet?text=[title]&url=[shortlink]&hashtags=CoachingBlogger
    and saved the changed file to my child-theme in the folder ‘includes’.

    But it doesn’t work. I do not get a different Output as the one specified in the original php-file. Do I need to include the Twitter widget.js or is it already included in enfold?
    I put this into my child-themes functions.php

    if is_single() {
    	echo '<script type="text/javascript async src="//platform.twitter.com/widgets.js"></script>';
    }

    I would also need to add a rel=”publisher” to the google+ Icon. Where would I add this?

    • This reply was modified 10 years, 2 months ago by shenom.
    #338723

    I changed the way I included the twitter-widgte to:

    if (is_single()) {
    	function load_twitter_widget() {
     		 wp_enqueue_script('twitter_widget', 'http://platform.twitter.com/widgets.js');
        }
        add_action('wp_enqueue_scripts', 'load_twitter_widget');
    } 

    But still no luck!! :(

    #338874

    Hey!

    Thank you for the update.

    I changed that line with your twitter format and it’s working fine. Please edit the file then remove browser cache before testing it.

    Regards,
    Ismael

    #338972

    Hello Ismael,

    the twitter format does work. I tested it, so there is nothing to change ([text] and [shortcode] are variables of the theme).
    Screenshot1

    But the changed code doesn’t get accepted, because the browser still uses the old code:
    Screenshot2

    I emptied all cache (Browser + from W3TC).

    This is how the code looks like in includes > helper-social-media.php
    Screenshot3

    • This reply was modified 10 years, 2 months ago by shenom.
    #339786

    Hi,

    Can you please create us an administrator account? post it here as a private reply.

    Regards,
    Josue

    #340041
    This reply has been marked as private.
    #340579

    So is anyone looking at the Problem with the Twitter-Links?

    #342446

    Hi!

    Your Twitter Links seem to work fine now. Could you fix it?

    Regards,
    Andy

    #342670

    Hello Andy,

    what makes you think the twitter-Link is working. I do not mean the twitter-icon at the top of the screen (above the header)
    I need the twitter-sharing button at the bottom of each single blog-post to show the hashtag I’ve added in
    includes > helper-social-media.php (See the screenshots I provided above)

    It still doesn’t work on any blog-post. For example: http://goo.gl/jRwj3s

    #342828

    Hey!

    It should work now, you were missing this line in child theme functions.php:

    require_once( 'includes/helper-social-media.php' );
    

    Regards,
    Josue

    #343363

    Thanks Josue,

    now it works indeed.

    Can you please explain, why the line above is needed in the child-themes function.php, while the helper-main-menu.php in the same folder is added/taken into account without any line (require_once) in the functions.php.

    I added a custom search-icon in the mobile header through a change of includes > helper-main-menu.php. This worked right away and I didn’t “activated” the changed php-file in the child-theme in the functions.php.

    #343518

    Hi!

    Because /includes/helper-main-menu.php is included in header.php:64 using get_template_part.

    Child themes can override these templates the same as before — the child theme will just need to create the same directory structure to do it. (So, /page-templates/one-column.php needs to be overridden with /page-templates/one-column.php, not /one-column.php.) And yes, we’re only looking one level down.

    http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/

    Regards,
    Josue

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.