• Home
  • Contact
  • Politică de confidențialitate
  • Despre noi
Bucurion Blog
  • Acasa
  • Personale
  • Internet
  • Sport
  • Credinta
  • Reportaj
  • Natura
  • Tehnologie
  • Video
  • Imobiliare
  • Contact
No Result
View All Result
  • Acasa
  • Personale
  • Internet
  • Sport
  • Credinta
  • Reportaj
  • Natura
  • Tehnologie
  • Video
  • Imobiliare
  • Contact
No Result
View All Result
Bucurion Blog
No Result
View All Result
Home Personale

Social options

by bucurion
in Personale
3
0
SHARES
9
VIEWS
Share on FacebookShare on Twitter

In acest tutorial vreau sa va arat cu poti sa faci la o tema wordpress in dashboard optiuni in panou pentru iconitele de social facebook,twitter,google plus.

Avem acest cod care se pune in functions.php

[codesyntax lang=”php” container=”div” blockstate=”expanded”]

/* Social Options in wp-admin */

add_action('admin_menu', 'thesis_custom_add_page'); // Moves the add page function in the WP dashboard admin menu via WP hook
function thesis_custom_add_page() { // Adds our test page to Thesis menu
add_submenu_page('thesis-options',__('More Options', 'ebox'), __('More Options', 'ebox'), 'edit_themes', 'more-options', 'more_options_admin');
add_theme_page('Social Options', 'Social Options', 'edit_themes', 'more-options', 'more_options_admin');
}
function more_options_admin() { // Our function (as seen above) that runs when the page is accessed
$tt_hidden_field_name = 'tt_submit_hidden';
$tt_twitter_option = 'tt_twitter_name'; // Option name (in db)
$tt_data_field_name = 'tt_twitter_field';

$gg_googleplus_option = 'gg_googleplus_name'; // Option name (in db)
$gg_data_field_name = 'gg_googleplus_field';

$fa_facebook_option = 'fa_facebook_name';
$fa_data_field_name = 'fa_facebook_field';

$tt_twitter_value = get_option($tt_twitter_option); // Read in existing option value from database
$fa_facebook_value = get_option($fa_facebook_option);
$gg_googleplus_value = get_option($gg_googleplus_option);

if( $_POST[ $tt_hidden_field_name ] == 'yes' ) { // If form has been sumbitted
$tt_twitter_value = $_POST[ $tt_data_field_name ]; // Read value from post
$fa_facebook_value = $_POST[ $fa_data_field_name ];
$gg_googleplus_value = $_POST[ $gg_data_field_name ];

update_option($tt_twitter_option, $tt_twitter_value); // Save value in database
update_option($fa_facebook_option, $fa_facebook_value);
update_option($gg_googleplus_option, $gg_googleplus_value);
?>
<div><p><strong>Your changes have been saved !</strong></p></div>
<?php
}

// Main screen:
echo '<div>';
echo "<h2>Social Options</h2>"; // header
?>
<div class="screen" style="width:700px;float:left;padding:40px;border:3px double #ccc;background:#EEEEEE;box-shadow:0 10px 12px -8px #777;">
<form name="form1" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
<input type="hidden" name="<?php echo $tt_hidden_field_name; ?>" value="yes">
<p>Twitter username:
<input type="text" name="<?php echo $tt_data_field_name; ?>" value="<?php echo $tt_twitter_value; ?>" size="25">
</p>

<p>Facebook URL :  https://
<input type="text" name="<?php echo $fa_data_field_name; ?>" value="<?php echo $fa_facebook_value;?>" size="25">
</p>

<p>Google plus URL : https://  
<input type="text" name="<?php echo $gg_data_field_name; ?>" value="<?php echo $gg_googleplus_value;?>" size="25">
</p>

<p><input type="submit" name="search" value="<?php _e('Saves the settings', 'ebox'); ?>" class="btn button-primary" style="text-shadow:none;" /></p>

</form>
</div>
</div>
<?php
}

[/codesyntax]

Dupa introducerea acestui cod se poate vedea cu apare in meniu.

Pentru ca sa se si vada in tema noastra eu le-am pus in single.php dar se pot pune oriunde doreste fiecare header,footer,sidebar.

[codesyntax lang=”php” container=”div” blockstate=”expanded”]

<div id="social" style="width:300px;float:left;height:40px;">
<?php
$twitter = get_option('tt_twitter_name');
$facebook = get_option('fa_facebook_name');
$googleplus = get_option('gg_googleplus_name');
?>
<p align="center"><?php if($twitter){?><a href="https://www.twitter.com/<?php echo $twitter;?>"><img src="<?php bloginfo('template_url');?>/images/twitter.png" /></a><?php } if($facebook){?> <a href="https://<?php echo $facebook;?>"><img src="<?php bloginfo('template_url');?>/images/facebook.png" /></a>
<?php } if($googleplus){?> <a href="https://<?php echo $googleplus;?>"><img src="<?php bloginfo('template_url');?>/images/google.png" /></a>
<?php } ?></p>
</div>

[/codesyntax]

Ce mai trebuie complectat sunt trei poze intr-un folder in tema numit images cu facebook.png,google.png si twitter.png..

Post Views: 646
Previous Post

Nu e bine sa predai lectii auto

Next Post

Religia vs Hristos

bucurion

Next Post

Religia vs Hristos

Comments 3

  1. Vice says:
    13 ani ago

    Eu foloseam alta metoda,multumim 🙂

    Răspunde
    • admin says:
      13 ani ago

      evident sunt atatea metode asta e doar una dintre ele…

      Răspunde
  2. Iulian says:
    13 ani ago

    Bun tutorialul. Mi se pare mult mai facil asa decat sa instalezi un plugin si sa iti incarci inutil site-ul

    Răspunde

Lasă un răspuns Anulează răspunsul

Adresa ta de email nu va fi publicată. Câmpurile obligatorii sunt marcate cu *

  • Trending
  • Comments
  • Latest

Centrala termica nu mai incalzeste apa – posibile cauze

24 aprilie 2023
Famous Roses

Când înfloresc trandafirii în grădinile noastre?

13 aprilie 2023

Cunosti toate semnificatiile bratarilor de picior?

13 aprilie 2023
vopsea decorativa interior

Vopsea decorativa interior – pentru o casa cu personalitate!

1 octombrie 2021

O bloggerita din China a ajuns…

20

Se va mai castiga la fel din bloguri in 2013?

18

Vreau sa iau un domeniu punct.ro

18

Pasiunea din copilarie

18
obraz umflat de la masea

Măselele de minte și impactul lor asupra sănătății tale dentare

27 ianuarie 2025

Proiectul „AgriPrenor de Viitor”: O șansă pentru tinerii liceeni de a deveni antreprenori în agricultură

21 ianuarie 2025

27 decembrie 2024
3 motive să investești într-o pompa de căldură hibridă pentru casa ta

3 motive să investești într-o pompa de căldură hibridă pentru casa ta

29 noiembrie 2024

Stiri recente

obraz umflat de la masea

Măselele de minte și impactul lor asupra sănătății tale dentare

27 ianuarie 2025

Proiectul „AgriPrenor de Viitor”: O șansă pentru tinerii liceeni de a deveni antreprenori în agricultură

21 ianuarie 2025

27 decembrie 2024
3 motive să investești într-o pompa de căldură hibridă pentru casa ta

3 motive să investești într-o pompa de căldură hibridă pentru casa ta

29 noiembrie 2024
Bucurion Blog

Blog de stiri

Categorii

  • Agricultura
  • Comunicate de presa
  • Credinta
  • fără categorie
  • Imobiliare
  • Internet
  • Masini
  • Natura
  • Personale
  • Reportaj
  • Sport
  • Tehnologie
  • Video

Noutati

obraz umflat de la masea

Măselele de minte și impactul lor asupra sănătății tale dentare

27 ianuarie 2025

Proiectul „AgriPrenor de Viitor”: O șansă pentru tinerii liceeni de a deveni antreprenori în agricultură

21 ianuarie 2025
  • Home
  • Contact
  • Politică de confidențialitate
  • Despre noi

© 2023 Bucur Blog - design by Digital Craft Agency.

No Result
View All Result
  • Home
  • Personale
  • Internet
  • Sport
  • Credinta
  • Reportaj
  • Natura
  • Tehnologie
  • Video
  • Imobiliare
  • Contact

© 2023 Bucur Blog - design by Digital Craft Agency.

Cookie
Folosim cookie-uri pentru analiză, performanță, securitate, reclame și social media. Cookie settingsACCEPT
Cookies

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Întotdeauna activate
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SALVEAZĂ ȘI ACCEPTĂ